[nem-en] What is additional_decls?

Kamil Skalski kamil.skalski at gmail.com
Fri Nov 17 20:49:11 CET 2006


You might add some debug to see the order of members in TypeBuilder.n:1834
This is the place where original members and additional are all typed
and added to final list
'member_list'

Alternatively it is possible that you are adding members AFTER
member_list is filled (thus in WithTypeMembers stage) and all members
added at this moment gets there in reversed order... (head of the
list)


On 11/17/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> >
> > When we parse the project in VS we have a strange problem. Method
> > TypeBuilder.GetFields() retrieves members in reversed order. It occurs in
> > consequence of adding of class members into additional_decls, and most
> > likely they are stored in reverse order.
> >
> > As a result, macro [Record] generate constructors with a reversed
> > arrangement of parameters.
> >
>
> It might be a general bug. It would probably occur also in following scenario:
>
> [Record]
> [Generate()]
> class Foo {
>   x : int;
>   y : int;
> }
>
> with
>
> [BeforeInheritance]
> macro Generate (tb : TypeBuilder, mem) {
>   tb.Define (<[ decl: z : string ]>);
>   tb.Define (<[ decl: w : float ]>);
> }
>
> --
> Kamil Skalski
> http://nazgul.omega.pl
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list