You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:33:01 UTC

[jira] [Closed] (GROOVY-10218) BUG! exception in phase 'instruction selection' when non-existent method called

     [ https://issues.apache.org/jira/browse/GROOVY-10218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-10218.
------------------------------

> 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.8, 4.0.0-beta-1, 3.0.9
>         Environment: linux
>            Reporter: Ian
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 4.0.0-beta-2, 3.0.10
>
>
> 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.20.1#820001)