groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Harvey <>
Subject Re: Extension method upgrades
Date Fri, 15 Dec 2017 05:10:46 GMT
I think your first step - "define a file that contains extension functions" -
is slightly wrong. In Kotlin, you can place extension methods anywhere, they
do not have to be confined to a single file (or worse, like Groovy, in a
totally different dependency). The syntax I discussed is what enables them
to do this.

I'm not sure of the troubles this introduces in a dynamic context, but it
seems your assumptions about the compiler reading in all classes then
parsing extension methods first is likely the correct way to do it. Maybe
someone with more knowledge can chime in. I do think multiple conflicting
extension methods should error in the exact same way that normal methods

I think allowing extensions or "import extensions" would be a step in the
right direction. The main technical hurdle seems to be allowing the methods
to be declared within the same project. From there it is just syntax

Sent from:

View raw message