Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt3899.kt
T
2015-10-07 15:50:23 +03:00

13 lines
465 B
Kotlin
Vendored

data class StringPair(val first: String, val second: String)
infix fun String.to(second: String) = StringPair(this, second)
fun hashMapOf(<!UNUSED_PARAMETER!>pair<!>: StringPair): MutableMap<String, String> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun F() : MutableMap<String, String> {
val value: String? = "xyz"
if (value == null) throw Error()
// Smart cast should be here
return hashMapOf("sss" to <!DEBUG_INFO_SMARTCAST!>value<!>)
}