Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0, 2.5.11
-
None
Description
Consider the following code
class A {} class B extends A{ def b() {}} class C extends A{} @CompileStatic static foo() { def x = new B() ({ x = new C() })() def z = x z.b() }
Here type of z in the last line of the method is deduced to be B. Attempt to execute z.b() leads to cast exception, which is unexpected under static compilation.