Fix KT-10805 for 'when'.

This commit is contained in:
Dmitry Petrov
2016-01-27 17:07:03 +03:00
parent 9db3440e72
commit c5fd496cc9
4 changed files with 52 additions and 1 deletions
@@ -0,0 +1,37 @@
val <!IMPLICIT_NOTHING_PROPERTY_TYPE!>test1<!> = when {
true -> { <!TYPE_MISMATCH!>{ true }<!> }
else -> TODO()
}
val test1a: () -> Boolean = when {
true -> { { true } }
else -> TODO()
}
val <!IMPLICIT_NOTHING_PROPERTY_TYPE!>test2<!> = when {
true -> { <!TYPE_MISMATCH!>{ true }<!> }
else -> when {
true -> { <!TYPE_MISMATCH!>{ true }<!> }
else -> TODO()
}
}
val test2a: () -> Boolean = when {
true -> { { true } }
else -> when {
true -> { <!TYPE_MISMATCH!>{ true }<!> } // TODO
else -> TODO()
}
}
val <!IMPLICIT_NOTHING_PROPERTY_TYPE!>test3<!> = when {
true -> { <!TYPE_MISMATCH!>{ true }<!> }
true -> { <!TYPE_MISMATCH!>{ true }<!> }
else -> TODO()
}
val test3a: () -> Boolean = when {
true -> { { true } }
true -> { { true } }
else -> TODO()
}
@@ -0,0 +1,8 @@
package
public val test1: kotlin.Nothing
public val test1a: () -> kotlin.Boolean
public val test2: kotlin.Nothing
public val test2a: () -> kotlin.Boolean
public val test3: kotlin.Nothing
public val test3a: () -> kotlin.Boolean