[nem-en] Bugs in extension method implementation
Kamil Skalski
kamil.skalski at gmail.com
Sat Aug 26 17:15:23 CEST 2006
Actually I ment, that there was no fresh bootstrap since I fixed the
bug (which was in revision 6553), so the bug with extension methods is
still present in nemerle/boot/ compiler. If you use the compiler
bootstraped on revision before your last commit (6578) it works ok.
>
> Try (in reference you need add Nemerle.Compiler.dll):
> using System.Console;
> using Nemerle.Compiler;
>
> def member : IMember = null;
> WriteLine(member.GetName())
>
> You get this error message:
> Main.n(5,11,5,25): error : there is no member named `GetName' in
> Nemerle.Compiler.IMember with type ?
Indeed, it fails with current boot/ version, but it works correctly
with out.stage3/ before your commit.
>
> I find error with the help of debugger. It source a different assemble
> modules (with same version) of Nemerle.dll loaded by compiler. In this case
> IsDefined() method report false even if in type exist ExtensionAttribute.
Well, this is strange, unless you compile using one compiler, but
referencing the other one, like:
boot/ncc.exe utility.n -r out.stage3/Nemerle.Compiler
in such case you need to switch to using the fresh Nemerle.dll library
(which is the correct way to do this, since out.stage3/NC is compiled
against out.stage3/Nemerle and you should not bring boot/Nemerle.dll
into scope of loaded libraries), like:
boot/ncc.exe utility.n -nostdlib -r ../out.stage3/Nemerle -r
out.stage3/Nemerle.Compiler -greedy-
>
> Check this solution and if it's OK, update bootstrap, please.
>
Could you try again with the version before patch and tell me how
exactly do I reproduce this error?
I don't like the patch, since IsDefined against assembly loaded into
SystemTypeCache is the *correct* (and probably fastest) way to check
for attributes.
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list