-
Bug
-
Resolution: Fixed
-
P2
-
13
-
b28
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8227185 | 14 | Jan Lahoda | P2 | Resolved | Fixed | b05 |
JDK-8228274 | 13.0.2 | Jan Lahoda | P2 | Resolved | Fixed | b01 |
JDK-8228058 | 13.0.1 | Jan Lahoda | P2 | Resolved | Fixed | master |
The below code should throw a compilation error as yield is used in incorrect context. However, the compilation goes through successfully.
interface TestIntf {
void foo(int[] a);
}
public class SwitchTest {
public static void main(String[] args) {
TestIntf expr = (yield a) -> {
System.out.println(a.length);
};
expr.foo(new int[]{12, 3, 45});
}
}
interface TestIntf {
void foo(int[] a);
}
public class SwitchTest {
public static void main(String[] args) {
TestIntf expr = (yield a) -> {
System.out.println(a.length);
};
expr.foo(new int[]{12, 3, 45});
}
}
- backported by
-
JDK-8227185 No compilation error reported when yield is used in incorrect context
-
- Resolved
-
-
JDK-8228058 No compilation error reported when yield is used in incorrect context
-
- Resolved
-
-
JDK-8228274 No compilation error reported when yield is used in incorrect context
-
- Resolved
-