[nem-bug] [Nemerle 0001014]: InheritConstructors macro

feedback at nemerle.org feedback at nemerle.org
Sat May 12 17:23:44 CEST 2007


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=1014> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   1014
Category:                   The Macro Library
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             05-12-2007 17:23 CEST
Last Modified:              05-12-2007 17:23 CEST
======================================================================
Summary:                    InheritConstructors macro
Description: 
If you inherit one class from another, some time, you should copy all it
constructors. Will be nice create macro which do it automatically.
For example. Instead of:
public class IntelliSenseModeTyper : Typer
{
  public this (m : MethodBuilder) { base (m) }
  public this (parent : Typer, fn : Typedtree.Fun_header) { base (parent,
fn) }
  public this (
    tb : TypeBuilder, 
    tenv : TyVarEnv,
    fn : Typedtree.Fun_header,
    env : GlobalEnv)
  {
    base (tb, tenv, fn, env)
  }
    
  protected override RunDelayedTypings () : void { ... }
  protected override RunSecondPass (_meth : MethodBuilder) : void { ... }
}

we could write:
[InheritConstructors]
public class IntelliSenseModeTyper : Typer
{
  protected override RunDelayedTypings () : void { ... }
  protected override RunSecondPass (_meth : MethodBuilder) : void { ... }
}

This macro should be not copy ctor if in new class already defined ctor
with same signature.
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-12-07 17:23 VladD2         New Issue                                    
======================================================================




More information about the bugs mailing list