Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.0.4
-
None
Description
I have a rather mundane Streams pipeline trying to group some items by a particular property.
@CompileStatic class GroovyExample { String category String title static Object organize(Collection<GroovyExample> examples) { examples.stream() .collect(groupingBy(GroovyExample::getCategory)) } }
This produces
Failed to find the expected method[getCategory(java.lang.Object)] in the type[GroovyExample]
This feels similar to GROOVY-9803 in that the apparent problem is a result of a nested generic call that, while unambiguous according to the JLS rules, doesn't get propagated tightly enough for the STC to correctly recognize that the target type is GroovyExample and thus the zero-argument method is the correct resolution.
Attachments
Issue Links
- is related to
-
GROOVY-10054 STC: Cannot infer lambda parameter types for a stream collector
- Open
-
GROOVY-10741 STC method pointer or reference to generated property method
- Closed