groovy git commit: Add a test for "GROOVY-6938: Wrong error reported by @CompileStatic when overriding a method returning a parameterized value"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: Add a test for "GROOVY-6938: Wrong error reported by @CompileStatic when overriding a method returning a parameterized value"

Daniel.Sun
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 6389d0bd1 -> d1970bcf6


Add a test for "GROOVY-6938: Wrong error reported by @CompileStatic when overriding a method returning a parameterized value"

(cherry picked from commit 3dd14f6)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d1970bcf
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d1970bcf
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d1970bcf

Branch: refs/heads/GROOVY_2_5_X
Commit: d1970bcf60f9cb95d859598389cafcb270ae4d71
Parents: 6389d0b
Author: sunlan <[hidden email]>
Authored: Tue May 15 22:44:17 2018 +0800
Committer: sunlan <[hidden email]>
Committed: Tue May 15 22:46:03 2018 +0800

----------------------------------------------------------------------
 .../groovy/bugs/groovy6938/Groovy6938Bug.groovy | 26 ++++++++++++++++++
 src/test/groovy/bugs/groovy6938/L.groovy        | 29 ++++++++++++++++++++
 src/test/groovy/bugs/groovy6938/LJava.java      | 26 ++++++++++++++++++
 3 files changed, 81 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d1970bcf/src/test/groovy/bugs/groovy6938/Groovy6938Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/groovy6938/Groovy6938Bug.groovy b/src/test/groovy/bugs/groovy6938/Groovy6938Bug.groovy
new file mode 100644
index 0000000..8b6a6d0
--- /dev/null
+++ b/src/test/groovy/bugs/groovy6938/Groovy6938Bug.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.groovy6938
+
+class Groovy6938Bug extends GroovyTestCase {
+    void test() {
+        assert null == new L().doSomething()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d1970bcf/src/test/groovy/bugs/groovy6938/L.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/groovy6938/L.groovy b/src/test/groovy/bugs/groovy6938/L.groovy
new file mode 100644
index 0000000..5d80b72
--- /dev/null
+++ b/src/test/groovy/bugs/groovy6938/L.groovy
@@ -0,0 +1,29 @@
+/*
+ *  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.groovy6938
+
+import groovy.transform.CompileStatic;
+
+@CompileStatic
+class L extends LJava<Integer> {
+    Integer doSomething() {
+        super.doSomething()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/d1970bcf/src/test/groovy/bugs/groovy6938/LJava.java
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/groovy6938/LJava.java b/src/test/groovy/bugs/groovy6938/LJava.java
new file mode 100644
index 0000000..90715b1
--- /dev/null
+++ b/src/test/groovy/bugs/groovy6938/LJava.java
@@ -0,0 +1,26 @@
+/*
+ *  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.groovy6938;
+
+public class LJava <T extends Number> {
+    public T doSomething() {
+        return null;
+    }
+}
\ No newline at end of file

Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun