Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.8, 4.0.0-beta-1, 3.0.9
-
None
-
None
-
linux
Description
My file "ite.groovy":
import groovy.transform.TypeChecked interface A {} @TypeChecked trait B implements A { def foo() { bar() } } class C implements B {} println new C().foo()
Fails to compile (as it should) but does not give a helpful error message:
$ groovy ite.groovy Caught: BUG! exception in phase 'instruction selection' in source unit '<my path>/ite.groovy' ClassNode#getTypeClass for A called before the type class is set BUG! exception in phase 'instruction selection' in source unit '<my path>/ite.groovy' ClassNode#getTypeClass for A called before the type class is set at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Remove the @TypeChecked and it gives a coherent and useful error.