groovy-eclipse icon indicating copy to clipboard operation
groovy-eclipse copied to clipboard

Open class implementing trait in editor or search for trait results in error

Open eric-milles opened this issue 7 years ago • 1 comments

Open the class in the Groovy Editor and the error below is logged. This may be related to #175, since the referenced trait is only reconciled to compile phase 3.

MyClass.groovy:

class MyClass implements MyTrait {
}

MyTrait.groovy:

trait MyTrait {
  def m() { 'm' }
}

Groovy:Groovy compiler error: exception in phase 'canonicalization' in source unit '...\eclipse-space\Groovy\src\main\traits2\MyClass.groovy' JDTClassNode.getTypeClass() cannot locate class for traits.MyTrait using transform loader groovy.lang.GroovyClassLoader@36edbb99

eric-milles avatar Apr 03 '18 15:04 eric-milles

Error does not occur if MyClass is in a Java source file -- Java does not run the Trait processing that Groovy does.

eric-milles avatar Apr 03 '18 15:04 eric-milles