https://github.com/rymiel approved this pull request.

Also works well for pattern matching
```java
switch (obj) {
  case String s when !s.isEmpty() -> 0;
  default                         -> 1;
}
```
and upcoming destructuring
```java
switch (n) {
  case IntExpr(int i)              -> i;
  case NegExpr(Expr n)             -> -1 * eval(n);
  case AddExpr(Expr lhs, Expr rhs) -> eval(lhs) + eval(rhs);
  case MulExpr(Expr lhs, Expr rhs) -> eval(lhs) * eval(rhs);
  default                          -> throw new IllegalStateException();
};
```

https://github.com/llvm/llvm-project/pull/91112
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to