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 11:50:20 UTC
[groovy-website] branch asf-site updated: Revert "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 58452b2 Revert "Update Groovy 4 release notes (show JEP 406 support)"
58452b2 is described below
commit 58452b26e253d191bb2f42696aa04bce213638a1
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jul 24 19:49:26 2021 +0800
Revert "Update Groovy 4 release notes (show JEP 406 support)"
This reverts commit 7a136cab
---
site/src/site/releasenotes/groovy-4.0.adoc | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/site/src/site/releasenotes/groovy-4.0.adoc b/site/src/site/releasenotes/groovy-4.0.adoc
index 01ba2d7..685b489 100644
--- a/site/src/site/releasenotes/groovy-4.0.adoc
+++ b/site/src/site/releasenotes/groovy-4.0.adoc
@@ -220,12 +220,14 @@ interface Expr { }
@Immutable class MulExpr implements Expr { Expr left, right }
int eval(Expr e) {
- 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()
+ 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()
+ }
}
}