I think this JIRA issue discusses some of the options and links to some older, 
similar requests.  https://issues.apache.org/jira/browse/GROOVY-11143

I don't think it has gained much traction since I first submitted it.
________________________________
From: Christopher Smith <[email protected]>
Sent: Friday, October 9, 2026 9:01 AM
To: [email protected] <[email protected]>
Subject: Static import for extension methods?

I use extension methods fairly heavily, up until now for creating tooling and 
application-specific DSLs, and now with LLM tooling I find the semantic 
compression helps improve the results. However, the restriction that extension 
methods have


I use extension methods fairly heavily, up until now for creating tooling and 
application-specific DSLs, and now with LLM tooling I find the semantic 
compression helps improve the results. However, the restriction that extension 
methods have to be compiled beforehand is a real friction point, making it 
impossible to write certain kinds of business DSLs that would be useful.

Kotlin resolves extension methods by statically importing the method and then 
treating that as on the search path. How difficult would it be for Groovy to 
support this mechanism also, so that methods in the same compilation unit (or, 
I suppose, third-party libraries without a manifest) could be used?

Reply via email to