[ https://issues.apache.org/jira/browse/GROOVY-11259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-11259: ------------------------------------ Assignee: Eric Milles > STC loses generic information on method references > -------------------------------------------------- > > Key: GROOVY-11259 > URL: https://issues.apache.org/jira/browse/GROOVY-11259 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Affects Versions: 4.0.17 > Reporter: Christopher Smith > Assignee: Eric Milles > Priority: Major > > In the following code, the correct return type of {{Map.Entry::getKey}} is > {{K = String}}, but the STC loses track of it and returns {{Object}}, leading > to downstream type mismatches. > {code:groovy} > @CompileStatic > class Repro { > void repro(Map<String, String> input) { > var keys = input.entrySet().stream() > .map(Map.Entry::getKey) > .toSet() > consume(keys) > } > static void consume(Set<String> keys) {} > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)