[nem-bug] [Nemerle 0000829]: Methods and properties can't have the same names

feedback at nemerle.org feedback at nemerle.org
Sat Jan 20 20:28:13 CET 2007


The following issue requires your FEEDBACK.
======================================================================
<http://nemerle.org/bugs/view.php?id=829> 
======================================================================
Reported By:                d
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   829
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
======================================================================
Date Submitted:             01-20-2007 20:15 CET
Last Modified:              01-20-2007 20:28 CET
======================================================================
Summary:                    Methods and properties can't have the same names
Description: 
class C {
  Test : int { get { 1 } }
  Test () : int { 1 }
}
// error: method C.Test() : int redefined in `C'
// error:   first definition here as property `C.Test : int'

// Is that by design ? If so - what's the rationle behind it ?
// Makes no sense to me.
======================================================================

----------------------------------------------------------------------
 nazgul - 01-20-07 20:28 
----------------------------------------------------------------------
This is by design:

1) code like this  def x = C().Test;  is ambiguous
2) it is usually an error if you don't know what construct you want to
use: property or method

Issue History
Date Modified  Username       Field                    Change              
======================================================================
01-20-07 20:15 d              New Issue                                    
01-20-07 20:28 nazgul         Note Added: 0001617                          
01-20-07 20:28 nazgul         Status                   new => feedback     
01-20-07 20:28 nazgul         Summary                  Methods and properties
can't have the same names => Methods and properties can\'t have the same names
01-20-07 20:28 nazgul         Description Updated                          
======================================================================




More information about the bugs mailing list