Skip to content

Remove APIs deprecated for removal in 0.19.0 - #2020

Open
igorwojda wants to merge 2 commits into
developfrom
con/0.19.0-deprecated-removal
Open

igorwojda wants to merge 2 commits into
developfrom
con/0.19.0-deprecated-removal

Conversation

@igorwojda

Copy link
Copy Markdown
Contributor

Removes every API marked Will be removed in version 0.19.0, since 0.19.0 ships as 1.0.0. Breaking: KoTypeDeclaration no longer extends KoDeclarationCastProvider, so cast/check calls now go through sourceDeclaration.

Removed

  • KoDeclarationCastProvider members on KoTypeDeclaration (isClass, asClassDeclaration(), hasClassDeclaration(), …) and their List<KoTypeDeclaration> extensions
  • KoSourceAndAliasTypeProvider, KoIsGenericTypeProvider, KoValModifierProvider, KoVarModifierProvider (+ list extensions)
  • isExternalType, asExternalTypeDeclaration(), hasExternalTypeDeclaration(Of)(), with/withoutExternalTypeDeclaration(Of)(), externalTypeDeclarations and other list properties (classDeclarations, …) replaced by functions
  • parameterTypes, numParameterTypes, countParameterTypes(), hasParameterType(), hasAllParameterTypes() (+ list extensions)

Migration

Before After
type.isClass type.sourceDeclaration?.isClass == true
type.asClassDeclaration() type.sourceDeclaration?.asClassDeclaration()
types.classDeclarations() types.sourceDeclarations().classDeclarations()
type.isAlias type.sourceDeclaration?.isImportAlias == true
type.isGenericType / withGenericType() type.isGeneric / withGeneric()
property.hasValModifier / withValModifier() property.isVal / withVal()
declaration.isExternalType declaration.isExternal
functionType.parameterTypes / hasParameterType {} functionType.parameters / hasParameter {}
// Before
Konsist.scopeFromProject().properties().assertTrue { it.type?.isInterface == true }

// After
Konsist.scopeFromProject().properties().assertTrue { it.type?.sourceDeclaration?.isInterface == true }

sourceType now detects import aliases via sourceDeclaration, so its behaviour is unchanged. Tests covering only removed APIs were deleted (equivalent tests for the replacement APIs already exist); remaining tests migrated.

KoTypeDeclaration no longer extends KoDeclarationCastProvider (use sourceDeclaration),
and KoSourceAndAliasTypeProvider, KoIsGenericTypeProvider, KoValModifierProvider,
KoVarModifierProvider plus deprecated *ExternalType* and *ParameterType* members are removed.
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

📦 Konsist snapshot published

Version 1.0.0-alpha.1-pr2020-20261013.083420-2
Latest snapshot 1.0.0-alpha.1-pr2020-SNAPSHOT
Commit 0bc13ed
Build Publish #11
Artifact konsist-1.0.0-alpha.1-pr2020-20261013.083420-2.jar (pom)
repositories {
    maven("https://central.sonatype.com/repository/maven-snapshots/")
}

dependencies {
    testImplementation("com.lemonappdev:konsist:1.0.0-alpha.1-pr2020-20261013.083420-2")
}

Snapshots are removed from the Central snapshots repository after 90 days.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant