[nem-en] Macros and extension methods
Kamil Skalski
kamil.skalski at gmail.com
Sat Jun 10 09:54:31 CEST 2006
2006/6/10, Alejandro Serrano <trupill at yahoo.es>:
> Michal Moskal escribió:
> > On 6/9/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> >> >From what I see the algorithm in compiler is:
> >> - add all available extension methods in given GlobalEnv
> >> - each x.foo is treated as overload EXT.foo (x, ...)
> >> - now as we have all the possible overloads (among them EXT.foo
> >> (x,..)), we can chose the best method
> >
> > This is exactly what happens.
> >
> In case there are two members that can be used (for example, the class
> already has a Select method) the compiler shows an error or uses the
> non-extension method (as in C#)
I think it does what C#, the extension method overload has lower
priority and there is no error.
The question for completion engine is if it is possible to filter out
those overloads, which will not be correct for 100%. Like we have 'x :
string' and extension mehod 'EXT.foo (y : array['a], ...)'.
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list