[nem-en] Typing a expression in context of method
vc
vc at rsdn.ru
Sat May 12 03:02:23 CEST 2007
Real project (StringTemplate for Nemerle alfa) attached to this message.
See file MacroTest1\MacroLibrary2\Macro1.n
See line 141.
> -----Original Message-----
> From: devel-en-bounces at nemerle.org [mailto:devel-en-bounces at nemerle.org]
> On Behalf Of vc
> Sent: Saturday, May 12, 2007 4:39 AM
> To: devel-en at nemerle.org
> Subject: RE: [nem-en] Typing a expression in context of method
>
> > This trick doe not work. If I try:
> > ...
> > mb.GetHeader().body = FunBody.Abstract();
> > def typer = Typer(mb);
> > ...
> > compiler throw exception in Typer3.Run().
>
> I foung temporary workaround: I generate fake code for method body:
>
> def paramsUse = mb.Ast.header.ParametersReferences.Map(p => <[ _ = $p;
> ]>);
> mb.GetHeader().body = FunBody.Parsed(<[ { ..$paramsUse }; null ]>);
> def typer = Typer(mb);
> ...
>
> But, it's very ugly :(.
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacroTest1-006.zip
Type: application/x-zip-compressed
Size: 23883 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20070512/9d234420/MacroTest1-006-0001.bin
More information about the devel-en
mailing list