mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Improved algorithm, added simple tests with generic types.
#KT-2776 in progress
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user