This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-dev-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new d0abf31 2026/05/07 05:53:06: Generated dev website from
groovy-website@b366299
d0abf31 is described below
commit d0abf31446f77642bffea72a932676784cc183ec
Author: jenkins <[email protected]>
AuthorDate: Thu May 7 05:53:06 2026 +0000
2026/05/07 05:53:06: Generated dev website from groovy-website@b366299
---
search/search-index.json | 4 +--
wiki/GEP-16.html | 83 ++++++++++++++++++++++++++++++++++++++++++++++--
wiki/geps.html | 2 +-
3 files changed, 83 insertions(+), 6 deletions(-)
diff --git a/search/search-index.json b/search/search-index.json
index 1b36f55..aece46b 100644
--- a/search/search-index.json
+++ b/search/search-index.json
@@ -884,7 +884,7 @@
{
"id": "wiki/geps.html",
"title": "The Apache Groovy programming language - GEPs",
- "content": "The Apache Groovy programming language - GEPs Socialize
Discuss on the mailing list Groovy on X Groovy on Bluesky Groovy on Mastodon
Groovy on LinkedIn Events and conferences Source code on GitHub Report issues
in Jira Stack Overflow questions Slack Community You are using an outdated
browser. Please upgrade your browser to improve your experience. Apache
Groovy™ Learn Documentation Download Support Contribute Ecosystem Blog
posts Socialize GEPs GEP-1 GEP-2 GEP- [...]
+ "content": "The Apache Groovy programming language - GEPs Socialize
Discuss on the mailing list Groovy on X Groovy on Bluesky Groovy on Mastodon
Groovy on LinkedIn Events and conferences Source code on GitHub Report issues
in Jira Stack Overflow questions Slack Community You are using an outdated
browser. Please upgrade your browser to improve your experience. Apache
Groovy™ Learn Documentation Download Support Contribute Ecosystem Blog
posts Socialize GEPs GEP-1 GEP-2 GEP- [...]
"url": "wiki/geps.html",
"site": "dev"
},
@@ -912,7 +912,7 @@
{
"id": "wiki/GEP-16.html",
"title": "The Apache Groovy programming language - Developer docs -
GEP-16",
- "content": "The Apache Groovy programming language - Developer docs -
GEP-16 Socialize Discuss on the mailing list Groovy on X Groovy on Bluesky
Groovy on Mastodon Groovy on LinkedIn Events and conferences Source code on
GitHub Report issues in Jira Stack Overflow questions Slack Community You are
using an outdated browser. Please upgrade your browser to improve your
experience. Apache Groovy™ Learn Documentation Download Support
Contribute Ecosystem Blog posts Socialize GE [...]
+ "content": "The Apache Groovy programming language - Developer docs -
GEP-16 Socialize Discuss on the mailing list Groovy on X Groovy on Bluesky
Groovy on Mastodon Groovy on LinkedIn Events and conferences Source code on
GitHub Report issues in Jira Stack Overflow questions Slack Community You are
using an outdated browser. Please upgrade your browser to improve your
experience. Apache Groovy™ Learn Documentation Download Support
Contribute Ecosystem Blog posts Socialize GE [...]
"url": "wiki/GEP-16.html",
"site": "dev"
},
diff --git a/wiki/GEP-16.html b/wiki/GEP-16.html
index cde21d6..24fe5fc 100644
--- a/wiki/GEP-16.html
+++ b/wiki/GEP-16.html
@@ -91,7 +91,7 @@
<strong>Version</strong>
</td>
<td class="hdlist2">
-<p>4</p>
+<p>6</p>
</td>
</tr>
<tr>
@@ -131,7 +131,7 @@
<strong>Last modification</strong>
</td>
<td class="hdlist2">
-<p>2026-04-12</p>
+<p>2026-05-07</p>
</td>
</tr>
</table>
@@ -628,6 +628,9 @@ keyword or identifier have to resolve one way. In
summary:</p>
<p><code>val</code> as a cast expression — <code>val as
Type</code> reads <code>val</code> as the keyword</p>
</li>
<li>
+<p>Standalone <code>val</code> (or <code>var</code>) expression-statement
before a declaration — parsed as a modifier on the
declaration that follows</p>
+</li>
+<li>
<p>Java class named <code>val</code> — the keyword wins in
declared-type positions</p>
</li>
</ul>
@@ -706,6 +709,47 @@ This also applies to <code>var</code>. It is a
pre-existing issue.
</div>
</div>
<div class="sect3">
+<h4
id="_standalone_val_or_var_expression_statement_before_a_declaration">Standalone
<code>val</code> (or <code>var</code>) expression-statement before a
declaration</h4>
+<div class="paragraph">
+<p>A bare <code>val</code> reference used as an expression-statement
immediately before
+a declaration is misparsed as a modifier on the declaration that follows:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">def m(Object obj) {
+ def val = obj
+ if (val instanceof String) {
+ println val.trim()
+ }
+ val // intended: reference the variable
+ def var = obj // ...but parsed as `val def var = obj`
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p><strong>Workarounds:</strong></p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">val;
// terminate the statement explicitly
+(val) // parenthesise
+ // or simply remove the reference if it has no
effect</code></pre>
+</div>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">
+This also applies to <code>var</code>. It is a pre-existing issue.
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect3">
<h4 id="_java_class_named_val">Java class named <code>val</code></h4>
<div class="paragraph">
<p>A Java class named <code>val</code> cannot be used directly as a declared
type or
@@ -714,6 +758,30 @@ positions. The workaround is to use a fully-qualified name
or import alias.
This matches the behavior <code>var</code> would have if Java permitted
<code>class var</code>.</p>
</div>
</div>
+<div class="sect3">
+<h4 id="_ide_syntax_highlighting_cosmetic">IDE syntax highlighting
(cosmetic)</h4>
+<div class="paragraph">
+<p>A pre-existing <code>var</code> issue (<a
href="https://issues.apache.org/jira/browse/GROOVY-9630">GROOVY-9630</a>)
+extends to <code>val</code> under GEP-16. When <code>def val</code> (or
<code>def var</code>) is followed by
+a line break or trailing comment and then a separate assignment:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">def val //
+val = 1</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The Groovy parser folds these into a single
declaration — the first <code>val</code>
+is treated as a modifier and the second as the variable
name — so the
+runtime result is the same as the intended <code>def val; val = 1</code>.
However,
+some IDEs (e.g. Eclipse) tokenize independently and may colorize the first
+<code>val</code> as a variable declaration rather than a modifier, leading to
+misleading highlighting. This is purely cosmetic; no workaround is needed
+for correctness, but adding a semicolon (<code>def val;</code>) or initializer
+(<code>def val = null</code>) makes the intent unambiguous to both parser and
IDE.</p>
+</div>
+</div>
</div>
<div class="sect2">
<h3 id="_migration_flag_groovy_val_enabled">Migration flag:
<code>groovy.val.enabled</code></h3>
@@ -739,6 +807,9 @@ All breaking changes listed above are resolved:</p>
<p><code>val as String</code> works (cast expression)</p>
</li>
<li>
+<p>Standalone <code>val</code> expression-statement before a declaration
works</p>
+</li>
+<li>
<p><code>class val {}</code> works (type declaration)</p>
</li>
<li>
@@ -791,6 +862,11 @@ was less widely understood. Since then, Kotlin adoption
has grown
significantly and <code>val</code>/<code>var</code> semantics are now familiar
to a broad
audience, making the case for this feature stronger.</p>
</li>
+<li>
+<p><a href="https://issues.apache.org/jira/browse/GROOVY-9630">GROOVY-9630:
var/val IDE syntax highlighting</a> — pre-existing cosmetic
issue for <code>var</code> (declaration split across lines is
+colorized as if the keyword were the variable name). The same situation
+applies to <code>val</code> under GEP-16; runtime behavior is unaffected.</p>
+</li>
</ul>
</div>
</div>
@@ -804,7 +880,8 @@ audience, making the case for this feature stronger.</p>
2 (2026-04-12) Added Java interop edge cases, spike implementation summary<br>
3 (2026-04-12) Added field naming edge case, Gradle motivation<br>
4 (2026-04-12) Added cast expression edge case, split code stats, linked spike
branch and JIRA<br>
-5 (2026-04-16) Added <code>groovy.val.enabled</code> migration flag</p>
+5 (2026-04-16) Added <code>groovy.val.enabled</code> migration flag<br>
+6 (2026-05-07) Added standalone <code>val</code> expression-statement edge
case; noted IDE highlighting issue (GROOVY-9630)</p>
</div>
</div>
</div></div></div></div></div><footer id='footer'>
diff --git a/wiki/geps.html b/wiki/geps.html
index 06bb16f..32582c8 100644
--- a/wiki/geps.html
+++ b/wiki/geps.html
@@ -63,7 +63,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div
class='row'><div class='row-fluid'><div class='col-lg-3'><ul
class='nav-sidebar'><li class='active'><a href='#gep'>GEPs</a></li><li><a
href='#GEP-1' class='anchor-link'>GEP-1</a></li><li><a href='#GEP-2'
class='anchor-link'>GEP-2</a></li><li><a href='#GEP-3'
class='anchor-link'>GEP-3</a></li><li><a href='#GEP-4'
class='anchor-link'>GEP-4</a></li><li><a href='#GEP-5'
class='anchor-link'>GEP-5</a></li><li><a href='#GEP-6' [...]
+ </div><div id='content' class='page-1'><div
class='row'><div class='row-fluid'><div class='col-lg-3'><ul
class='nav-sidebar'><li class='active'><a href='#gep'>GEPs</a></li><li><a
href='#GEP-1' class='anchor-link'>GEP-1</a></li><li><a href='#GEP-2'
class='anchor-link'>GEP-2</a></li><li><a href='#GEP-3'
class='anchor-link'>GEP-3</a></li><li><a href='#GEP-4'
class='anchor-link'>GEP-4</a></li><li><a href='#GEP-5'
class='anchor-link'>GEP-5</a></li><li><a href='#GEP-6' [...]
<div class='row'>
<div class='colset-3-footer'>
<div class='col-1'>