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 2019/08/23 09:22:53 UTC
[groovy] 02/02: GROOVY-9226: Calling super.toString() with
@TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 97783c783c87cdf8af9e18359c904979532eb089
Author: Daniel Sun <su...@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
(cherry picked from commit 007877d9b5414ddd08ac34444a30c9712bf5754c)
---
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()
+ '''
+ }
+
+}