Fix wrong nullability enhancement for annotated java.lang.Object type

Effectively, this commit drops cached value for j.l.Object type
This cache was introduced when types were immutable, but they
became mutable after starting reading top-level TYPE_USE annotations,
that lead to changing shared JAVA_LANG_OBJECT_CLASSIFIER_TYPE instance

 #KT-20826 Fixed
This commit is contained in:
Denis Zharkov
2017-10-20 09:43:25 +03:00
parent 3c9ef6d319
commit da52716bfd
8 changed files with 69 additions and 26 deletions
@@ -0,0 +1,17 @@
// FILE: A.java
import org.checkerframework.checker.nullness.qual.*;
public class A {
@NonNull
public Object foo() { return null; }
}
// FILE: B.java
public class B {
public static void assertNonNull(Object x) {}
}
// FILE: main.kt
fun main() {
A()
B.assertNonNull(null)
}
@@ -0,0 +1,21 @@
package
public fun main(): kotlin.Unit
public open class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@org.checkerframework.checker.nullness.qual.NonNull public open fun foo(): @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class B {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
// Static members
public open fun assertNonNull(/*0*/ x: kotlin.Any!): kotlin.Unit
}