groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
Date Thu, 15 Aug 2019 07:19:39 GMT
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 007877d  GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic
will throw java.lang.StackOverflowError
007877d is described below

commit 007877d9b5414ddd08ac34444a30c9712bf5754c
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Thu Aug 15 15:18:43 2019 +0800

    GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
---
 src/test/groovy/bugs/Groovy9226Bug.groovy | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy9226Bug.groovy b/src/test/groovy/bugs/Groovy9226Bug.groovy
new file mode 100644
index 0000000..30fd05d
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy9226Bug.groovy
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package groovy.bugs
+
+class Groovy9226Bug extends GroovyTestCase {
+    void testDuplicatedAnnotations5() {
+        assertScript '''
+            import groovy.transform.CompileStatic
+            import groovy.transform.TypeChecked
+            
+            @CompileStatic
+            class Super {
+              String toString() { 'Super' }
+            }
+            
+            @TypeChecked
+            @CompileStatic
+            class Child extends Super {
+              String toString() { 'Child extends ' + super.toString() }
+            }
+            
+            assert new Child().toString()
+        '''
+    }
+
+}


Mime
View raw message