Files
kotlin/compiler/testData/codegen/boxWithStdlib/classes/kt8011.kt
dnpetrov 36ae8790a1 KT-8011 Compiler crashes on attempt to create local class inside lambda
- use StackValue from upper-level context if local lookup fails

 #KT-8011 Fixed
2015-06-18 17:40:24 +03:00

17 lines
291 B
Kotlin
Vendored

fun testFun1(str: String): String {
val local = str
class Local {
fun foo() = str
}
val list = listOf(0).map { Local() }
return list[0].foo()
}
fun box(): String {
return when {
testFun1("test1") != "test1" -> "Fail #1"
else -> "OK"
}
}