This is an automated email from the ASF dual-hosted git repository.
emilles 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 a0f367a GROOVY-9500: add test case
a0f367a is described below
commit a0f367a24eeb5c4d03da31d56f9dd113efc9d580
Author: Eric Milles <[email protected]>
AuthorDate: Sun Oct 17 13:16:38 2021 -0500
GROOVY-9500: add test case
---
.../groovy/transform/stc/GenericsSTCTest.groovy | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 50e5272..c49b4a6 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -517,6 +517,39 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
'''
}
+ // GROOVY-9500
+ void testReturnTypeInferenceWithMethodGenerics20() {
+ assertScript '''
+ trait Entity<D> {
+ }
+
+ abstract class Path<F extends Entity, T extends Entity> implements
Iterable<Path.Segment<F,T>> {
+ interface Segment<F, T> {
+ F start()
+ T end()
+ }
+
+ abstract F start()
+ T end() {
+ end // Cannot return value of type Path$Segment<F,T> on
method returning type T
+ }
+ T end
+
+ @Override
+ void forEach(java.util.function.Consumer<? super Segment<F,
T>> action) {
+ }
+ @Override
+ Spliterator<Segment<F, T>> spliterator() {
+ }
+ @Override
+ Iterator<Segment<F, T>> iterator() {
+ }
+ }
+
+ null
+ '''
+ }
+
void testDiamondInferrenceFromConstructor1() {
assertScript '''
class Foo<U> {