Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
A trait extending another and calling itself more than 3 times:
@CompileStatic trait UpperTrait { void call(Closure body){ body() } }
@CompileStatic
trait LowerTrait extends UpperTrait {
void threeCalls() {
call {
call {
call {
}
}
}
}
}
Will generate a `ClassCastException` when called:
class ImplementsTrait implements LowerTrait { } new ImplementsTrait().threeCalls()
raises:
Caught: java.lang.ClassCastException: LowerTrait$Trait$Helper$_threeCalls_closure1 cannot be cast to UpperTrait java.lang.ClassCastException: LowerTrait$Trait$Helper$_threeCalls_closure1 cannot be cast to UpperTrait at LowerTrait$Trait$Helper$_threeCalls_closure1$_closure2.doCall(LowerTrait.groovy:9) etc..