Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7
-
None
Description
The below will execute the constructor on `Other` that takes an `Object`, even though `getName()` returns a `String`.
import groovy.transform.CompileStatic @CompileStatic class Parent { protected String getName() { "sally" } } @CompileStatic class Child extends Parent { Inner doSomething() { return new Inner() { void go() { new Other(name) } } } } @CompileStatic class Other { Other(Object object) { println "called with other" } Other(String string) { println "called with string" } } @CompileStatic abstract class Inner { abstract void go() } Inner inner = new Child().doSomething() inner.go()
Attachments
Issue Links
- relates to
-
GROOVY-11198 access to public static variable forbidden in enum
- Closed
-
GROOVY-11199 inner class cannot set property of enclosing class that has a getter without a setter
- Closed
- links to