mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 00:14:50 +00:00
[jdk26] Out of an abundance of caution: Added a test to confirm that lombok does not interact with primitive types in switch pattern matching. Indeed it doesn't.
This commit is contained in:
2 files changed
+21
No files matched your search
@@ -0,0 +1,10 @@
|
||||
public class Switch26 {
|
||||
String switchPatternMatching(int i) {
|
||||
return switch (i) {
|
||||
case 1 -> "one";
|
||||
case 5 -> "five";
|
||||
case int y when y >= 0 -> "+" + y;
|
||||
case int y -> "-" + -y;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// version 26:
|
||||
public class Switch26 {
|
||||
String switchPatternMatching(int i) {
|
||||
return switch (i) {
|
||||
case 1 -> "one";
|
||||
case 5 -> "five";
|
||||
case int y when y >= 0 -> "+" + y;
|
||||
case int y -> "-" + -y;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user