Checking for return type in kotlin signature if have super methods.
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public interface CantMakeImmutableInSubclass {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun foo(): MutableCollection<String>")
|
||||
Collection<String> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
@ExpectLoadError("Return type is changed to not subtype for method which overrides another: List<String>, was: MutableList<String>")
|
||||
@KotlinSignature("fun foo(): List<String>")
|
||||
List<String> foo();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait CantMakeImmutableInSubclass: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun foo(): MutableCollection<String>
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.CantMakeImmutableInSubclass : java.lang.Object {
|
||||
public abstract trait test.CantMakeImmutableInSubclass.Sub : test.CantMakeImmutableInSubclass.Super {
|
||||
public abstract override /*1*/ fun foo(): jet.MutableList<jet.String>
|
||||
}
|
||||
public abstract trait test.CantMakeImmutableInSubclass.Super : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableCollection<jet.String>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user