Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.17, 4.0.12
-
None
Description
Error message:
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.
Simple example reproducing the error:
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> {} }