Improved algorithm, added simple tests with generic types.

#KT-2776 in progress
This commit is contained in:
Evgeny Gerashchenko
2012-11-02 20:01:03 +04:00
parent 1f4d994480
commit 494345ce10
12 changed files with 243 additions and 12 deletions

View File

@@ -0,0 +1,20 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNullabilitySameGenericType1 {
@KotlinSignature("fun foo(): MutableList<String>")
public List<String> foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNullabilitySameGenericType1 {
@KotlinSignature("fun foo(): MutableList<String?>")
public List<String> foo() {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNullabilitySameGenericType1 : java.lang.Object() {
public open fun foo(): MutableList<String> = throw UnsupportedOperationException()
public open class Sub: AddNullabilitySameGenericType1() {
override fun foo(): MutableList<String> = throw UnsupportedOperationException()
}
}

View File

@@ -0,0 +1,10 @@
namespace test
public open class test.AddNullabilitySameGenericType1 : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameGenericType1
public open fun foo(): jet.MutableList<jet.String>
public open class test.AddNullabilitySameGenericType1.Sub : test.AddNullabilitySameGenericType1 {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameGenericType1.Sub
public open override /*1*/ fun foo(): jet.MutableList<jet.String>
}
}

View File

@@ -0,0 +1,20 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class AddNullabilitySameGenericType2 {
@KotlinSignature("fun foo(): MutableList<String>")
public List<String> foo() {
throw new UnsupportedOperationException();
}
public class Sub extends AddNullabilitySameGenericType2 {
@KotlinSignature("fun foo(): MutableList<String>?")
public List<String> foo() {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class AddNullabilitySameGenericType2 : java.lang.Object() {
public open fun foo(): MutableList<String> = throw UnsupportedOperationException()
public open class Sub: AddNullabilitySameGenericType2() {
override fun foo(): MutableList<String> = throw UnsupportedOperationException()
}
}

View File

@@ -0,0 +1,10 @@
namespace test
public open class test.AddNullabilitySameGenericType2 : java.lang.Object {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameGenericType2
public open fun foo(): jet.MutableList<jet.String>
public open class test.AddNullabilitySameGenericType2.Sub : test.AddNullabilitySameGenericType2 {
public final /*constructor*/ fun <init>(): test.AddNullabilitySameGenericType2.Sub
public open override /*1*/ fun foo(): jet.MutableList<jet.String>
}
}

View File

@@ -0,0 +1,19 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class InheritNullabilitySameGenericType {
@KotlinSignature("fun foo(): MutableList<String>")
public List<String> foo() {
throw new UnsupportedOperationException();
}
public class Sub extends InheritNullabilitySameGenericType {
public List<String> foo() {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -0,0 +1,11 @@
package test
import org.jetbrains.annotations.NotNull
public open class InheritNullabilitySameGenericType : java.lang.Object() {
public open fun foo(): MutableList<String> = throw UnsupportedOperationException()
public open class Sub: InheritNullabilitySameGenericType() {
override fun foo(): MutableList<String> = throw UnsupportedOperationException()
}
}

View File

@@ -0,0 +1,10 @@
namespace test
public open class test.InheritNullabilitySameGenericType : java.lang.Object {
public final /*constructor*/ fun <init>(): test.InheritNullabilitySameGenericType
public open fun foo(): jet.MutableList<jet.String>
public open class test.InheritNullabilitySameGenericType.Sub : test.InheritNullabilitySameGenericType {
public final /*constructor*/ fun <init>(): test.InheritNullabilitySameGenericType.Sub
public open override /*1*/ fun foo(): jet.MutableList<jet.String>
}
}