Introduced simple propagation of nullability on loading Java.

#KT-2776 in progress
This commit is contained in:
Evgeny Gerashchenko
2012-11-02 15:12:24 +04:00
parent 961fde3c8a
commit 1f4d994480
21 changed files with 367 additions and 2 deletions
@@ -0,0 +1,19 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNotNullJavaSubtype {
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNotNullJavaSubtype {
@NotNull
public String foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNotNullJavaSubtype : java.lang.Object() {
public open fun foo(): CharSequence? = throw UnsupportedOperationException()
public open class Sub: AddNotNullJavaSubtype() {
override fun foo(): String = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.AddNotNullJavaSubtype : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNotNullJavaSubtype
public open fun foo(): jet.CharSequence?
public open class test.AddNotNullJavaSubtype.Sub : test.AddNotNullJavaSubtype {
public final /*constructor*/ fun <init>(): test.AddNotNullJavaSubtype.Sub
public open override /*1*/ fun foo(): jet.String
}
}
@@ -0,0 +1,19 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNotNullSameJavaType {
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNotNullSameJavaType {
@NotNull
public CharSequence foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNotNullSameJavaType : java.lang.Object() {
public open fun foo(): CharSequence? = throw UnsupportedOperationException()
public open class Sub: AddNotNullSameJavaType() {
override fun foo(): CharSequence = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.AddNotNullSameJavaType : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNotNullSameJavaType
public open fun foo(): jet.CharSequence?
public open class test.AddNotNullSameJavaType.Sub : test.AddNotNullSameJavaType {
public final /*constructor*/ fun <init>(): test.AddNotNullSameJavaType.Sub
public open override /*1*/ fun foo(): jet.CharSequence
}
}
@@ -0,0 +1,20 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNullabilityJavaSubtype {
@NotNull
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNullabilityJavaSubtype {
@KotlinSignature("fun String? foo()")
public String foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNullabilityJavaSubtype : java.lang.Object() {
public open fun foo(): CharSequence = throw UnsupportedOperationException()
public open class Sub: AddNullabilityJavaSubtype() {
override fun foo(): String = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.AddNullabilityJavaSubtype : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNullabilityJavaSubtype
public open fun foo(): jet.CharSequence
public open class test.AddNullabilityJavaSubtype.Sub : test.AddNullabilityJavaSubtype {
public final /*constructor*/ fun <init>(): test.AddNullabilityJavaSubtype.Sub
public open override /*1*/ fun foo(): jet.String
}
}
@@ -0,0 +1,20 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNullabilitySameJavaType {
@NotNull
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNullabilitySameJavaType {
@KotlinSignature("fun CharSequence? foo()")
public CharSequence foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNullabilitySameJavaType : java.lang.Object() {
public open fun foo(): CharSequence = throw UnsupportedOperationException()
public open class Sub: AddNullabilitySameJavaType() {
override fun foo(): CharSequence = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.AddNullabilitySameJavaType : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameJavaType
public open fun foo(): jet.CharSequence
public open class test.AddNullabilitySameJavaType.Sub : test.AddNullabilitySameJavaType {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameJavaType.Sub
public open override /*1*/ fun foo(): jet.CharSequence
}
}
@@ -0,0 +1,19 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class InheritNullabilityJavaSubtype {
@NotNull
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends InheritNullabilityJavaSubtype {
public String foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class InheritNullabilityJavaSubtype : java.lang.Object() {
public open fun foo(): CharSequence = throw UnsupportedOperationException()
public open class Sub: InheritNullabilityJavaSubtype() {
override fun foo(): String = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.InheritNullabilityJavaSubtype : java.lang.Object {
public final /*constructor*/ fun <init>(): test.InheritNullabilityJavaSubtype
public open fun foo(): jet.CharSequence
public open class test.InheritNullabilityJavaSubtype.Sub : test.InheritNullabilityJavaSubtype {
public final /*constructor*/ fun <init>(): test.InheritNullabilityJavaSubtype.Sub
public open override /*1*/ fun foo(): jet.String
}
}
@@ -0,0 +1,19 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.lang.CharSequence;
import jet.runtime.typeinfo.KotlinSignature;
public class InheritNullabilitySameJavaType {
@NotNull
public CharSequence foo() {
throw new UnsupportedOperationException();
}
public class Sub extends InheritNullabilitySameJavaType {
public CharSequence foo() {
throw new UnsupportedOperationException();
}
}
}
@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class InheritNullabilitySameJavaType : java.lang.Object() {
public open fun foo(): CharSequence = throw UnsupportedOperationException()
public open class Sub: InheritNullabilitySameJavaType() {
override fun foo(): CharSequence = throw UnsupportedOperationException()
}
}
@@ -0,0 +1,10 @@
namespace test
public open class test.InheritNullabilitySameJavaType : java.lang.Object {
public final /*constructor*/ fun <init>(): test.InheritNullabilitySameJavaType
public open fun foo(): jet.CharSequence
public open class test.InheritNullabilitySameJavaType.Sub : test.InheritNullabilitySameJavaType {
public final /*constructor*/ fun <init>(): test.InheritNullabilitySameJavaType.Sub
public open override /*1*/ fun foo(): jet.CharSequence
}
}