[Spec tests] Updating tests for kotlin 1.4.0
This commit is contained in:
committed by
Victor Petukhov
parent
ab3b63c92a
commit
1caafdc9d4
Vendored
+1
-1
@@ -1 +1 @@
|
||||
java.lang.IllegalStateException: TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH: Type inference failed. Expected type mismatch: inferred type is Test<Nothing?> but Base<T> was expected (7,38) in /KotlinClass.kt
|
||||
java.lang.IllegalStateException: TYPE_MISMATCH: Type mismatch: inferred type is Test<Nothing?> but Base<T> was expected (7,38) in /KotlinClass.kt
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Test<T> extends Base<T> {
|
||||
|
||||
open class Base<out T>(val prop: T)
|
||||
|
||||
class Inheritor <T : Any> {
|
||||
class Inheritor<T : Any> {
|
||||
companion object {
|
||||
fun <T> default(): Base<T> = Test(null)
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: flexibility
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check Nothing flexibillity
|
||||
* ISSUES: KT-35700
|
||||
*/
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass{
|
||||
public static <T> T id(T x) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinClass.kt
|
||||
|
||||
fun box(): String {
|
||||
val x = JavaClass.id(null) // Nothing!
|
||||
|
||||
return try {
|
||||
val a = if (x) {
|
||||
"NOK"
|
||||
} else "NOK"
|
||||
a
|
||||
} catch (e: IllegalStateException) {
|
||||
"OK"
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: flexibility
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: check Nothing flexibillity
|
||||
* ISSUES: KT-35700
|
||||
*/
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
public class Test<T> extends Base<T> {
|
||||
public Test (T arg) {
|
||||
super(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: KotlinClass.kt
|
||||
|
||||
open class Base<out T>(val prop: T)
|
||||
|
||||
class Inheritor <T : Any> {
|
||||
companion object {
|
||||
fun <T> default(): Base<T> = Test(null)
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String{
|
||||
val v: Base<String> = Inheritor.default()
|
||||
try {
|
||||
println(v.prop.length)
|
||||
}catch (e: Exception ){
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user