Daniel Sun created GROOVY-12811:
-----------------------------------
Summary: A statically imported method still wins over a delegate
method inside with{}
Key: GROOVY-12811
URL: https://issues.apache.org/jira/browse/GROOVY-12811
Project: Groovy
Issue Type: Bug
Components: Compiler
Reporter: Daniel Sun
GROOVY-5239 (Closed/Fixed in 4.0.0-beta-1, 3.0.10, and 2.5.16) covered
statically imported methods versus other methods of the same name. The
remaining test `bugs.Groovy5239#testStaticImportVersusDelegateMethod` in
`src/test/groovy/bugs/Groovy5239.groovy` is still `@NotYetImplemented`. After
`import static ...PublicStatic.who`, `new C().with { assert 'C' == who() }`
should call `C.who()`, not the static import.
Scanned SHA: `ca71425976fd2e3da6db9634955ba0d39550a6d4`.
Re-checked on 22 Nov 2026 (Asia/Taipei) at the same SHA by temporarily removing
@NotYetImplemented and running the test on JDK 17: it still fails. assert 'C'
== who() failed because who() returned 'PublicStatic'. The statically imported
method still wins over the delegate method inside with{}.
**Acceptance criterion:** The `with` closure resolves `who()` to the delegate,
and `@NotYetImplemented` is removed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)