Implicit nothing / intersection types are now checked also for member functions #KT-11666 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0ea3b4ade4
commit
4c03aaabd4
@@ -16,3 +16,21 @@ fun check() {
|
||||
// Unreachable / unused, but not implicit Nothing
|
||||
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>x<!> =<!> null!!
|
||||
}
|
||||
|
||||
class Klass {
|
||||
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>bar<!>() = null!!
|
||||
|
||||
val <!IMPLICIT_NOTHING_PROPERTY_TYPE!>y<!> = null!!
|
||||
|
||||
init {
|
||||
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>local<!>() = bar()
|
||||
// Should be unreachable: see KT-5311
|
||||
val z = null!!
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
fun <!IMPLICIT_NOTHING_RETURN_TYPE!>local<!>() = bar()
|
||||
|
||||
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>x<!> =<!> y
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user