You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/07/24 09:24:33 UTC
[groovy-website] branch asf-site updated: Update Groovy 4 release
notes (show JEP 406 support)
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 7a136ca Update Groovy 4 release notes (show JEP 406 support)
7a136ca is described below
commit 7a136cabd674f178985171495f208362075053fa
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jul 24 17:24:16 2021 +0800
Update Groovy 4 release notes (show JEP 406 support)
---
site/src/site/releasenotes/groovy-4.0.adoc | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/site/src/site/releasenotes/groovy-4.0.adoc b/site/src/site/releasenotes/groovy-4.0.adoc
index 685b489..01ba2d7 100644
--- a/site/src/site/releasenotes/groovy-4.0.adoc
+++ b/site/src/site/releasenotes/groovy-4.0.adoc
@@ -220,14 +220,12 @@ interface Expr { }
@Immutable class MulExpr implements Expr { Expr left, right }
int eval(Expr e) {
- e.with {
- switch(it) {
- case IntExpr -> i
- case NegExpr -> -eval(n)
- case AddExpr -> eval(left) + eval(right)
- case MulExpr -> eval(left) * eval(right)
- default -> throw new IllegalStateException()
- }
+ switch(e) {
+ case IntExpr(i) -> i
+ case NegExpr(n) -> -eval(n)
+ case AddExpr(left, right) -> eval(left) + eval(right)
+ case MulExpr(left, right) -> eval(left) * eval(right)
+ default -> throw new IllegalStateException()
}
}