[nem-en] Re: Perform macro on members defined by macro.
Kamil Skalski
kamil.skalski at gmail.com
Sat Mar 10 10:25:10 CET 2007
The first thing that comes to my mind is that the NotNull is added to
method too late - that is when it was already processed (typed). This
shouldn't happen though, since you process the macros before any
method body gets typed - which gets us to suspicion, that this is not
true.
2007/3/10, Ivan A Eryshov <ivan.eryshov at gmail.com>:
> I was investigating this problem. Seems that I don't know about some
> secrets, because of things that I discover were surprise me.
>
> First of all, method TypeBuilder.add_macros_from_parsedmems(...) works as
> expected. It adds macro expansion to TypesManager which adds expansion to
> attribute_macros_queue.
> Then the expansion of the AddMethWithNotNullParam macro is finished. And the
> expansion on the NotNull macro is started. When the NotNull macro is
> performed the method's body contains the assertion:
> <nemerle>
> {
> assert ((_prm : object) != null,
> "The ``NotNull'' contract of parameter `"
> + "_prm" + "' has been violated.");
> object ()
> }
> </nemerle>
> But, when the compilation is completed, assertion is disappearing. I have no
> ideas why this is so. Please advice.
>
> ==
> BWR, Ivan Eryshov.
>
> > -----Original Message-----
> > From: devel-en-bounces at nemerle.org [mailto:devel-en-bounces at nemerle.org]
> > On Behalf Of Michal Moskal
> > Sent: Friday, March 02, 2007 5:11 PM
> > To: devel-en at nemerle.org
> > Subject: Re: [nem-en] Re: Perform macro on members defined by macro.
> >
> > On 2/28/07, Ivan A Eryshov <ivan.eryshov at gmail.com> wrote:
> > > Kamil, Michal,
> > > What method TypeBuilder.add_macros_from_parsedmems(...) does?
> >
> > It's supposed to run the NotNull macro in your example. It seems
> > somethings doesn't work though...
> >
> >
> > --
> > Michal
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list