On Thursday, 21 November 2024 at 8:04:39 pm UTC+11 Thomas Broyer wrote:
Could be related to https://github.com/gwtproject/gwt/issues/10044Fwiw, the issue fixed in 2.12.1 was not about the "case x -> foo" vs "case x -> { foo }" but about enclosing the whole switch inside a block.On Thursday, November 21, 2024 at 9:28:51 AM UTC+1 ma...@craig-mitchell.com wrote:The release notes for 2.12.1 ( https://www.gwtproject.org/release-notes.html#Release_Notes_2_12_1 ) say:> Switch statements can correctly compile without being contained in bracesFor me, they compile, but they don't work. Eg. This code:GWT.log("Test 1 - Start");
switch (1) {
case 1 -> {
GWT.log("Test 1 - 1");
}
case 2 -> {
GWT.log("Test 1 - 2");
}
case 3 -> {
GWT.log("Test 1 - 3");
}
}
GWT.log("Test 1 - Done");
GWT.log("Test 2 - Start");
switch (1) {
case 1 -> GWT.log("Test 2 - 1");
case 2 -> GWT.log("Test 2 - 2");
case 3 -> GWT.log("Test 2 - 3");
}
GWT.log("Test 2 - Done");Will never get to the last "Test 2 - Done" line. The output will be:Test 1 - Start
Test 1 - 1
Test 1 - Done
Test 2 - Start
Test 2 - 1Is this a known issue?Thanks.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/813a36c4-81cc-44af-97ab-48cfdb04289fn%40googlegroups.com.
No comments:
Post a Comment