Implicit Nothing return type is now deprecated

This commit is contained in:
Mikhail Glukhikh
2015-10-09 17:42:36 +03:00
parent 65f0f312ff
commit 64543e3f52
27 changed files with 47 additions and 21 deletions
@@ -6,7 +6,7 @@ fun testCommasAndWhitespaces() {
<!UNREACHABLE_CODE!>bar(<!> 1 , todo() , <!UNREACHABLE_CODE!>"" )<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -15,7 +15,7 @@ fun test3() {
<!UNREACHABLE_CODE!>bar(<!>11, l@(todo()/*comment*/), <!UNREACHABLE_CODE!>"")<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
fun bar(<!UNUSED_PARAMETER!>i<!>: Int, <!UNUSED_PARAMETER!>s<!>: String, <!UNUSED_PARAMETER!>a<!>: Any) {}
@@ -8,4 +8,4 @@ fun testInvokeWithLambda() {
todo()<!UNREACHABLE_CODE!>(1){ 42 }<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -8,4 +8,4 @@ fun test12() {
todo()<!UNNECESSARY_SAFE_CALL!>?.<!><!UNREACHABLE_CODE!>bar(1)<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -14,7 +14,7 @@ fun test3() {
<!UNREACHABLE_CODE!>bar()<!>
}
fun throwNPE() = null!!
fun throwNPE(): Nothing = null!!
class A {
operator fun plus(<!UNUSED_PARAMETER!>a<!>: A): Nothing = throw Exception()
@@ -37,4 +37,4 @@ fun testArrayPlusAssign(array: Array<Any>) {
array[1] <!UNREACHABLE_CODE!>+=<!> todo()
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -15,4 +15,4 @@ fun testPlusAssign() {
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -35,5 +35,5 @@ fun returnInBinary2(): Boolean {
(return true) <!UNREACHABLE_CODE!>|| (return false)<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
fun bar() {}
@@ -10,4 +10,4 @@ fun testArgumentInVariableAsFunctionCall(f: (Any) -> Unit) {
f<!UNREACHABLE_CODE!>(<!>todo()<!UNREACHABLE_CODE!>)<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -21,4 +21,4 @@ fun unreachable4(array: Array<Any>) {
}
fun bar(a: Any) {}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -8,5 +8,5 @@ fun testIf1(b: Boolean) {
bar()
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
fun bar() {}
@@ -10,4 +10,4 @@ fun testCompound1() {
<!UNREACHABLE_CODE!>(<!>todo() <!UNREACHABLE_CODE!>* "")[1]<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -32,5 +32,5 @@ fun testFunctionDefaultArgument() {
open class Foo(i: Int) {}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
fun bar() {}
@@ -17,5 +17,5 @@ fun testDoWhile() {
<!UNREACHABLE_CODE!>bar()<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
fun bar() {}
@@ -2,4 +2,4 @@ fun testReturn() {
<!UNREACHABLE_CODE!>return<!> todo()
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()
@@ -12,4 +12,4 @@ fun testPostfixSpecial() {
todo()<!UNNECESSARY_NOT_NULL_ASSERTION, UNREACHABLE_CODE!>!!<!>
}
fun todo() = throw Exception()
fun todo(): Nothing = throw Exception()