[nem-bug] [Nemerle 0000993]: Record macro: improve work with base ctors

feedback at nemerle.org feedback at nemerle.org
Mon Apr 23 21:57:14 CEST 2007


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=993> 
======================================================================
Reported By:                divan
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   993
Category:                   The Macro Library
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             04-23-2007 19:53 CEST
Last Modified:              04-23-2007 21:57 CEST
======================================================================
Summary:                    Record macro: improve work with base ctors
Description: 
1) Record can produce bad ctor
class Base { 
  public this (x : int = 3) {} 
}
[Record] // E: duplicate parameter name: x
class Inh : Base { 
  x : int
};
With different names we'll get not too good ctor too, it'll require 2
params.

2) Probably there must be an option to use only default base ctor
2.1) With that option default base ctor params should work
3) And/or only one/some base ctor (for example by specifying syntax of
call, like "base (int)" or "base (2)")
4) Possibly params that go to base ctor should be renamed, so we'll have
something like "this (base_x, x)"
======================================================================

----------------------------------------------------------------------
 nazgul - 04-23-07 21:57 
----------------------------------------------------------------------
I think in this case we have two problems - first that parameters in
generated ctor should be alpha-renamed to not conflict with each other,
second with base ctor having default param we should generate two
overloads of current class' ctors (the other option would be to append new
parameters to the beginning and make the last param with default value, but
this would in inconsitent with current schema)

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-23-07 19:53 divan          New Issue                                    
04-23-07 21:57 nazgul         Note Added: 0001848                          
======================================================================




More information about the bugs mailing list