Tests for issues fixed in ed95463
#KT-2831 Fixed #KT-3286 Fixed #KT-3863 Fixed #KT-3976 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Exception in thread "main" java.lang.VerifyError: (class: org/jetbrains/kannotator/controlFlowBuilder/GraphBuilderInterpreter, method: binaryOperation signature: (Lorg/objectweb/asm/tree/AbstractInsnNode;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;)Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;) Wrong return type in function
|
||||
|
||||
fun foo(): Nothing = throw Exception()
|
||||
|
||||
fun bar(x: Any): Int {
|
||||
return when(x) {
|
||||
is String -> 0
|
||||
is Int -> 1
|
||||
else -> foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
bar(3)
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fun test(x: Int): String = when(x) {
|
||||
0 -> "zero"
|
||||
1 -> "one"
|
||||
2 -> "two"
|
||||
else -> blowUpHorribly()
|
||||
}
|
||||
|
||||
fun blowUpHorribly(): Nothing = throw RuntimeException("Blow up!")
|
||||
|
||||
fun box(): String {
|
||||
test(1)
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// java.lang.VerifyError: (class: org/jetbrains/jet/plugin/completion/handlers/NotImplemented, method: get signature: (Ljava/lang/Object;Ljet/PropertyMetadata;)Ljava/lang/Object;) Unable to pop operand off an empty stack
|
||||
|
||||
class NotImplemented<T>(){
|
||||
fun get(thisRef: Any?, prop: PropertyMetadata): T = notImplemented()
|
||||
fun set(thisRef: Any?, prop: PropertyMetadata, value: T) = notImplemented()
|
||||
}
|
||||
|
||||
fun notImplemented() : Nothing = notImplemented()
|
||||
|
||||
class Test {
|
||||
val x: Int by NotImplemented<Int>()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Test()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// java.lang.ClassNotFoundException: jet.Nothing
|
||||
|
||||
var currentAccountId: Int? by SessionAccessor()
|
||||
class SessionAccessor<T> {
|
||||
fun get(o : Nothing?, desc: jet.PropertyMetadata): T {
|
||||
return null as T
|
||||
}
|
||||
|
||||
fun set(o : Nothing?, desc: jet.PropertyMetadata, value: T) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
currentAccountId = 1
|
||||
if (currentAccountId != null) return "Fail"
|
||||
return "OK"
|
||||
}
|
||||
@@ -4357,6 +4357,26 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/hashable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt2831.kt")
|
||||
public void testKt2831() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/kt2831.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3286.kt")
|
||||
public void testKt3286() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/kt3286.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3863.kt")
|
||||
public void testKt3863() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/kt3863.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3976.kt")
|
||||
public void testKt3976() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/kt3976.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nothing.kt")
|
||||
public void testNothing() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/typeMapping/nothing.kt");
|
||||
|
||||
Reference in New Issue
Block a user