FIR: Fix forEach resolution within local class

This commit is contained in:
Denis.Zharkov
2021-10-11 13:18:09 +03:00
committed by TeamCityServer
parent 056657525e
commit cac69edff2
6 changed files with 50 additions and 0 deletions
@@ -0,0 +1,25 @@
// SKIP_TXT
// FIR_IDENTICAL
// FULL_JDK
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
// FILE: A.java
import java.util.List;
public class A {
public static List<String> foo() { return null; }
}
// FILE: main.kt
fun bar(): Int {
return object {
fun baz(): Int {
val strings = A.foo()
strings.forEach {
if (it.length == 0) return 1
}
return 2
}
}.baz()
}