Added propagation error message when array of subtype is used in return type of sub method.

EA-43482 - ISE: JavaFunctionResolver.checkFunctionsOverrideCorrectly
This commit is contained in:
Evgeny Gerashchenko
2013-02-15 19:14:19 +04:00
parent 1de5da1e8a
commit cd06bdedfe
4 changed files with 87 additions and 5 deletions
@@ -0,0 +1,19 @@
package test;
import java.util.List;
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
public interface ArraysInSubtypes {
interface Super {
CharSequence[] array();
List<? extends CharSequence[]> listOfArray();
}
interface Sub extends Super {
@ExpectLoadError("Return type is not a subtype of overridden method. To fix it, add annotation with Kotlin signature to super method with type Array<CharSequence>? replaced with Array<out CharSequence>? in return type")
String[] array();
@ExpectLoadError("Return type is not a subtype of overridden method. To fix it, add annotation with Kotlin signature to super method with type Array<CharSequence>? replaced with Array<out CharSequence>? in return type")
List<? extends String[]> listOfArray();
}
}
@@ -0,0 +1,14 @@
package test
public trait ArraysInSubtypes : java.lang.Object {
public trait Sub : test.ArraysInSubtypes.Super {
public abstract override /*1*/ fun array() : jet.Array<jet.String>?
public abstract override /*1*/ fun listOfArray() : jet.MutableList<out jet.Array<jet.String>?>?
}
public trait Super : java.lang.Object {
public abstract fun array() : jet.Array<jet.CharSequence>?
public abstract fun listOfArray() : jet.MutableList<out jet.Array<jet.CharSequence>?>?
}
}