Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Take this class
package compilestatic import groovy.transform.Canonical; import groovy.transform.CompileStatic; @CompileStatic class WTF { public static void main(String[] args) { new Person(name:"First") first(new Person(name:"First")) } static Person first(Person p) { p } } @Canonical class Person { String name }
The following exception is thrown:
Caught: java.lang.NoSuchMethodError: compilestatic.Person.<init>(Ljava/util/Map;)V java.lang.NoSuchMethodError: compilestatic.Person.<init>(Ljava/util/Map;)V at compilestatic.WTF.main(wtf.groovy:10)
Note that this exception comes from the second statement in the main method. Comment out that statement and there is no exception.