This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 1b70ef49a3 GROOVY-8801: add a test case
1b70ef49a3 is described below
commit 1b70ef49a30627c62375c24cfe60e4db03361a44
Author: Daniel Sun <[email protected]>
AuthorDate: Sun May 17 22:46:59 2026 +0900
GROOVY-8801: add a test case
---
src/test/groovy/gls/scope/FinalAccessTest.groovy | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/test/groovy/gls/scope/FinalAccessTest.groovy
b/src/test/groovy/gls/scope/FinalAccessTest.groovy
index a56d72ae76..0ace389af9 100644
--- a/src/test/groovy/gls/scope/FinalAccessTest.groovy
+++ b/src/test/groovy/gls/scope/FinalAccessTest.groovy
@@ -66,4 +66,18 @@ final class FinalAccessTest extends CompilableTestSupport {
}
"""
}
+
+ // GROOVY-8801
+ @Test
+ void testFinalVariable() {
+ assertScript '''
+ final Object v
+ try {
+ v = "hello world"
+ } catch (Exception e) {
+ throw new RuntimeException("goodbye")
+ }
+ assert 'hello world' == v
+ '''
+ }
}