[Spec tests] Fix tests
This commit is contained in:
+3
-2
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
@@ -6,14 +7,14 @@
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: todo
|
||||
* DESCRIPTION: check kotlin.Nothing by throwing the exception
|
||||
*/
|
||||
|
||||
fun foo(): Nothing {
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
fun box() {
|
||||
fun box(): String {
|
||||
try {
|
||||
foo()
|
||||
} catch (e: Exception) {
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* RELEVANT PLACES: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: todo
|
||||
*/
|
||||
@@ -20,7 +21,7 @@ fun foo2(): Unit {
|
||||
fun foo3(): Unit {
|
||||
}
|
||||
|
||||
fun box(){
|
||||
fun box(): String {
|
||||
val u1 = foo1()
|
||||
val u2 = foo2()
|
||||
val u3 = foo3()
|
||||
|
||||
+4
-4
@@ -6,16 +6,16 @@
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: type-system, type-kinds, built-in-types, kotlin.nothing -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: todo
|
||||
* DESCRIPTION: check the allowance of returning Nothing where String is expected
|
||||
*/
|
||||
|
||||
|
||||
fun foo(s: String?): String {
|
||||
val data = s ?: throw IllegalArgumentException("not null string is expected");
|
||||
return s ?: throw IllegalArgumentException("not null string is expected");
|
||||
}
|
||||
|
||||
fun box() {
|
||||
val result = "NOK"
|
||||
fun box(): String {
|
||||
var result = "NOK"
|
||||
val b = foo("")
|
||||
try {
|
||||
val a = foo(null)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "todo",
|
||||
"description": "check the allowance of returning Nothing where String is expected",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user