[
https://issues.apache.org/jira/browse/GROOVY-11071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-11071.
------------------------------
> Compiler error related to getAt and interface methods
> -----------------------------------------------------
>
> Key: GROOVY-11071
> URL: https://issues.apache.org/jira/browse/GROOVY-11071
> Project: Groovy
> Issue Type: Bug
> Components: class generator
> Affects Versions: 3.0.17, 4.0.12
> Reporter: Daniel Huss
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
>
> *Error message:*
> {code:none}
> BUG! exception in phase 'class generation' in source unit
> '...Reproducer.groovy' At line 11 column 21
> On receiver: myMap with message: getAt and arguments: new Reproducer$Key()
> This method should not have been called. {code}
> *Simple example reproducing the error:*
> {code:groovy}
> import groovy.transform.CompileStatic
> import org.junit.jupiter.api.Test
> @CompileStatic
> class Reproducer {
> @Test
> void reproduce() {
> MyMap myMap = null
> try {
> println(myMap[new Key()].toString())
> } catch (NullPointerException ignored) {
> // Expected
> }
> }
> static class Key {}
> static interface SomeMap<SELF extends SomeMap<SELF, K, V>, K, V> {
> V getAt(K key);
> }
> static interface MyMap extends SomeMap<MyMap, Key, Object> {}
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)