[ https://issues.apache.org/jira/browse/GROOVY-10196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17400356#comment-17400356 ]
Paul King commented on GROOVY-10196: ------------------------------------ [~szpak] Thanks for the version info. Well have to find a good way to get git bisect working again for such versions. Older builds currently fail since they relied upon bintray. I'll try to document the required hacks to workaround the issue(s) somewhere. > "Cannot find matching method" with specific class hierarchy and static > compilation > ---------------------------------------------------------------------------------- > > Key: GROOVY-10196 > URL: https://issues.apache.org/jira/browse/GROOVY-10196 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 3.0.8 > Reporter: Marcin Zajaczkowski > Assignee: Eric Milles > Priority: Minor > > Groovy static compilation reports: > > {code:java} > > Task :compileTestGroovy > startup failed: > /home/.../ReproCannotFindMethod.groovy: 11: [Static type checking] - Cannot > find matching method > com.example.repro.LinkedMultiValueMap3#add(java.lang.String, > java.lang.String). Please check if the declared type is correct and if the > method exists. > @ line 11, column 9. > map.add("foo", "bar") > ^ > 1 error > {code} > in some weird, but still valid hierarchy of classes: > > {code:java} > @CompileStatic > class ReproCannotFindMethod { > static ups() { > LinkedMultiValueMap3<String, String> map = new LinkedMultiValueMap3<>() > //fails on add() > // MultiValueMapAdapter3<String, String> map = new > MultiValueMapAdapter3<>() //works fine with add() > map.add("foo", "bar") > } > } > interface Map3<K, V> { > } > interface MultiValueMap3<K, V> extends Map3<K, List<V>> { > void add(K key, V value); > } > class MultiValueMapAdapter3<K, V> implements MultiValueMap3<K, V> { > @Override > void add(K key, V value) { > } > } > class LinkedMultiValueMap3<K, V> extends MultiValueMapAdapter3<K, V> { > } > {code} > > It is definitely a corner case, so it might not be worth to fix it, but I > report it as I've encountered it in a class hierarchy available related to > LinkedMultiValueMap in Spring Framework (classes originally in Java). > Reproduced with Groovy 3.0.8 -- This message was sent by Atlassian Jira (v8.3.4#803005)