[nem-en] Re: [svn] r6779: nemerle/trunk: . Build-1-phase.cmdBuild.cmd BuildAndReg-Release.cmd BuildAndReg.cmd NCC.npro...

Kamil Skalski kamil.skalski at gmail.com
Mon Oct 30 08:42:57 CET 2006


Delegates have special node in parsetree, so it should be easy to do
similar mixed approach as in IsInterface, etc. properties where we use
different checks according to compilation stage. I will do this later.

On 10/30/06, vc <vc at rsdn.ru> wrote:
>    > Was it necessary? The new way of marking type as delegate does not
>    > work with macros - if macro adds new delegate in a later stage of
>    > compilation, then members gets created during call to Define - and
>    > they use IsDelegate property on the type they are declared in. But if
>    > you mark type as delegate AFTER call to Define, it is too late for its
>    > members to notice this.
>    >
>    > Because of this, the testsuite/macroprog.n test is failing.
>
>    I use it property in the BeforeInheritance stage. See line 136 in
> macros\compiler.n. In this stage the parent_type field is not yet set and
> old implementation of IsDelegate return false for all types.
>
>    May be set the is_delegate at delegate added in old stage? Or combine two
> approaches? For example:
>    public override IsDelegate : bool
>    {
>      get
>      {
>        if (is_delegate)
>          true
>        else
>        {
>          parent_type != null
>          && parent_type.tycon.FullName == "System.MulticastDelegate"
>        }
>      }
>    }
>
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


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



More information about the devel-en mailing list