Details
-
Bug
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
2.4.12
-
None
Description
import groovy.transform.CompileStatic @CompileStatic class A {} @CompileStatic class B {} @CompileStatic class Parent { protected A ff = new A() A getFf() { ff } } @CompileStatic class Child extends Parent { protected B ff = new B() } @CompileStatic class Usage extends Child { def test() { println ff // A@id println getFf() // A@id println this.@ff // B@id } def test2() { I.wantsB(ff) // ScriptBytecodeAdapter.castToType(((Usage)this).getFf(), B.class)) is generated (wrong) I.wantsB(getFf()) // [STC] - Cannot find matching method I#wantsB(A) I.wantsB(this.@ff) // [STC] - Cannot find matching method I#wantsB(A) (wrong) } } @CompileStatic class I { static void wantsB(B b) {} } new Usage().test()
Attachments
Issue Links
- is related to
-
GROOVY-11381 STC: field and interface default method accessor property
- Closed
- links to