This is an automated email from the ASF dual-hosted git repository.

sunlan 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 6ebd888f76 Add a test case
6ebd888f76 is described below

commit 6ebd888f76a077c85294e6e01b6e2479dfc809cb
Author: Daniel Sun <[email protected]>
AuthorDate: Sat Jul 5 03:47:14 2025 +0900

    Add a test case
---
 src/test/groovy/bugs/Groovy4721.groovy | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy4721.groovy 
b/src/test/groovy/bugs/Groovy4721.groovy
index 57321789a4..ab1d2c91c8 100644
--- a/src/test/groovy/bugs/Groovy4721.groovy
+++ b/src/test/groovy/bugs/Groovy4721.groovy
@@ -468,4 +468,17 @@ final class Groovy4721 {
             assert java.test(0) == groovy.test(0)
         """
     }
+
+    @Test
+    void testFinallyWithThrowExceptionInTry() {
+        def err = shouldFail '''
+            try {
+                def msg = "from-try"
+                throw new RuntimeException(msg)
+            } finally {
+                throw new RuntimeException("from-finally")
+            }
+        '''
+        assert err =~ /from-finally/
+    }
 }

Reply via email to