[Spec tests] Updating tests for kotlin 1.4.0
This commit is contained in:
committed by
Victor Petukhov
parent
ab3b63c92a
commit
1caafdc9d4
Vendored
+3
-11
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
|
||||
@@ -13,24 +12,17 @@
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass{
|
||||
public static <T> T id(T x) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Boolean x;
|
||||
}
|
||||
|
||||
// FILE: KotlinClass.kt
|
||||
import java.lang.IllegalStateException
|
||||
|
||||
fun box(): String {
|
||||
val x = JavaClass.id(null) // Nothing!
|
||||
|
||||
return try {
|
||||
val a = if (x) {
|
||||
"NOK"
|
||||
} else "NOK"
|
||||
val a = if (JavaClass().x) { "NOK" } else "NOK"
|
||||
a
|
||||
} catch (e: java.lang.IllegalStateException) {
|
||||
} catch (e: java.lang.NullPointerException) {
|
||||
"OK"
|
||||
}
|
||||
}
|
||||
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-220
|
||||
* PLACE: expressions, conditional-expression -> paragraph 6 -> sentence 1
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: The type of the condition expression must be a subtype of kotlin.Boolean, otherwise it is an error
|
||||
*/
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass{
|
||||
public Boolean x;
|
||||
}
|
||||
|
||||
// FILE: KotlinClass.kt
|
||||
import java.lang.IllegalStateException
|
||||
|
||||
fun box(): String {
|
||||
return try {
|
||||
val a = if (JavaClass().x) { "NOK" } else "NOK"
|
||||
a
|
||||
} catch (e: java.lang.IllegalStateException) {
|
||||
"OK"
|
||||
}
|
||||
}
|
||||
Vendored
-6
@@ -2,12 +2,6 @@
|
||||
"6": {
|
||||
"pos": {
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-220",
|
||||
"casesNumber": 0,
|
||||
"description": "The type of the condition expression must be a subtype of kotlin.Boolean, otherwise it is an error",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-220",
|
||||
"casesNumber": 0,
|
||||
|
||||
Reference in New Issue
Block a user