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

vc vc at rsdn.ru
Mon Oct 30 03:28:40 CET 2006


   > 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"
       }
     }
   }
   




More information about the devel-en mailing list