Skip to content

Commit

Permalink
AA: implement comprehensive nullability check for flexible types
Browse files Browse the repository at this point in the history
  • Loading branch information
neetopia committed Mar 13, 2023
1 parent 3fde562 commit a482031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class KSTypeImpl private constructor(internal val type: KtType) : KSType {
}

override val nullability: Nullability by lazy {
if (type.nullability == KtTypeNullability.NON_NULLABLE) {
Nullability.NOT_NULL
} else {
Nullability.NULLABLE
when {
type is KtFlexibleType && type.lowerBound.nullability != type.upperBound.nullability -> Nullability.PLATFORM
analyze { type.canBeNull } -> Nullability.NULLABLE
else -> Nullability.NOT_NULL
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ class KSPAATest : AbstractKSPAATest() {
runTest("../test-utils/testData/api/javaModifiers.kt")
}

@Disabled
@TestMetadata("javaNonNullTypes.kt")
@Test
fun testJavaNonNullTypes() {
Expand Down

0 comments on commit a482031

Please sign in to comment.