Added tests on labels
#KT-1703 Fixed #KT-361 Fixed #KT-3920 Fixed #KT-3988 Fixed #KT-4247 Fixed #KT-4586 Fixed #KT-4603 Fixed #KT-591 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//KT-1703 Reference to label is unresolved
|
||||
|
||||
fun test() {
|
||||
val ints = Array<Int?>(2, { null })
|
||||
ints.forEach @lit {
|
||||
if (it == null) <!RETURN_NOT_ALLOWED_EXPLICIT_RETURN_TYPE_REQUIRED!>return @lit<!>
|
||||
use(<!DEBUG_INFO_AUTOCAST!>it<!> + 5)
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> Array<out T>.forEach(operation: (T) -> Unit) {
|
||||
for (element in this) operation(element)
|
||||
}
|
||||
|
||||
fun use(a: Any?) = a
|
||||
Reference in New Issue
Block a user