Supported simplest case of signatures propagation in value parameter position.

#KT-2776 in progress
This commit is contained in:
Evgeny Gerashchenko
2012-11-21 20:39:37 +04:00
parent 6530d48785
commit 4da03f75f9
15 changed files with 229 additions and 16 deletions
@@ -0,0 +1,14 @@
package test;
import org.jetbrains.annotations.NotNull;
public interface InheritNullability {
public interface Super {
void foo(@NotNull String p);
}
public interface Sub extends Super {
void foo(String p);
}
}
@@ -0,0 +1,12 @@
package test
public trait InheritNullability: Object {
public trait Super: Object {
public fun foo(p0: String)
}
public trait Sub: Super {
override fun foo(p0: String)
}
}
@@ -0,0 +1,10 @@
namespace test
public abstract trait test.InheritNullability : java.lang.Object {
public abstract trait test.InheritNullability.Sub : test.InheritNullability.Super {
public abstract override /*1*/ fun foo(/*0*/ p0: jet.String): jet.Tuple0
}
public abstract trait test.InheritNullability.Super : java.lang.Object {
public abstract fun foo(/*0*/ p0: jet.String): jet.Tuple0
}
}
@@ -0,0 +1,18 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
public interface NotNullToNullable {
public interface Super {
void foo(@NotNull String p);
}
public interface Sub extends Super {
@ExpectLoadError("Auto type 'jet.String' is not-null, while type in alternative signature is nullable: 'String?'")
@KotlinSignature("fun foo(p: String?)")
void foo(String p);
}
}
@@ -0,0 +1,12 @@
package test
public trait NotNullToNullable: Object {
public trait Super: Object {
public fun foo(p0: String)
}
public trait Sub: Super {
override fun foo(p0: String)
}
}
@@ -0,0 +1,10 @@
namespace test
public abstract trait test.NotNullToNullable : java.lang.Object {
public abstract trait test.NotNullToNullable.Sub : test.NotNullToNullable.Super {
public abstract override /*1*/ fun foo(/*0*/ p0: jet.String): jet.Tuple0
}
public abstract trait test.NotNullToNullable.Super : java.lang.Object {
public abstract fun foo(/*0*/ p0: jet.String): jet.Tuple0
}
}
@@ -0,0 +1,17 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
public interface NullableToNotNull {
public interface Super {
void foo(String p);
}
public interface Sub extends Super {
@ExpectLoadError("In superclass type is nullable: [String?], in subclass it is not: String")
void foo(@NotNull String p);
}
}
@@ -0,0 +1,12 @@
package test
public trait NullableToNotNull: Object {
public trait Super: Object {
public fun foo(p0: String?)
}
public trait Sub: Super {
override fun foo(p0: String?)
}
}
@@ -0,0 +1,10 @@
namespace test
public abstract trait test.NullableToNotNull : java.lang.Object {
public abstract trait test.NullableToNotNull.Sub : test.NullableToNotNull.Super {
public abstract override /*1*/ fun foo(/*0*/ p0: jet.String?): jet.Tuple0
}
public abstract trait test.NullableToNotNull.Super : java.lang.Object {
public abstract fun foo(/*0*/ p0: jet.String?): jet.Tuple0
}
}