Files
kotlin/compiler/testData/diagnostics/tests/implicitNothing.kt
Mikhail Glukhikh 99a32b93fb Implemented missed checks for local functions #KT-10449 Fixed
Relevant code/test fixes
2015-12-23 18:22:32 +03:00

19 lines
505 B
Kotlin
Vendored

fun <!IMPLICIT_NOTHING_RETURN_TYPE!>foo<!>() = throw Exception()
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>bar<!>() = null!!
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>baz<!>() = bar()
fun gav(): Any = null!!
val <!IMPLICIT_NOTHING_PROPERTY_TYPE!>x<!> = null!!
val y: Nothing = throw Exception()
fun check() {
// Error: KT-10449
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>local<!>() = bar()
// Unreachable / unused, but not implicit Nothing
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>x<!> =<!> null!!
}