[nem-bug] [Nemerle 0000984]: Ugly error message if incorrect default value for parameter

feedback at nemerle.org feedback at nemerle.org
Tue Apr 3 18:09:53 CEST 2007


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=984> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   984
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             04-02-2007 00:30 CEST
Last Modified:              04-03-2007 18:09 CEST
======================================================================
Summary:                    Ugly error message if incorrect default value for
parameter
Description: 
module Program
{
  Test(_ = false : bool) : void // E: invalid default value for parameter
'_N_u1583': '(false : bool)', only literals are supported
  {
  }
  
  Main() : void { }
}

The 'invalid default value' is ugly. Compiler must say:
Incorrect format of parameter default value. You should use 'paramName =
<literal> : <type>'.
======================================================================

----------------------------------------------------------------------
 divan - 04-03-07 18:09 
----------------------------------------------------------------------
I suggest inferring type instead of error in that case.
After all just (_ = false) compiles.
Also it'll allow to write (_ = 1u)

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-02-07 00:30 VladD2         New Issue                                    
04-03-07 18:09 divan          Note Added: 0001831                          
======================================================================




More information about the bugs mailing list