Ian created GROOVY-10218:
----------------------------

             Summary: BUG! exception in phase 'instruction selection' when 
non-existent method called
                 Key: GROOVY-10218
                 URL: https://issues.apache.org/jira/browse/GROOVY-10218
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.9, 4.0.0-beta-1, 3.0.8
         Environment: linux
            Reporter: Ian


My file "ite.groovy":
{noformat}
import groovy.transform.TypeChecked
interface A {}
@TypeChecked
trait B implements A {
  def foo() {
    bar()
  }
}
class C implements B {}
println new C().foo()
{noformat}
Fails to compile (as it should) but does not give a helpful error message:
{noformat}
$ 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){noformat}
Remove the @TypeChecked and it gives a coherent and useful error. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to