[nem-bug] [Nemerle 0000984]: Ugly error message if incorrect
default value for parameter
feedback at nemerle.org
feedback at nemerle.org
Tue Apr 3 21:31:20 CEST 2007
The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=984>
======================================================================
Reported By: VladD2
Assigned To: nazgul
======================================================================
Project: Nemerle
Issue ID: 984
Category: Compiler
Reproducibility: always
Severity: minor
Priority: normal
Status: resolved
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 04-02-2007 00:30 CEST
Last Modified: 04-03-2007 21:31 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:12
----------------------------------------------------------------------
I suggest inferring type instead of error in that case.
After all just (_ = false) compiles.
Also it'll allow to write (_ = 1u) and (_ : short = 1s)
----------------------------------------------------------------------
nazgul - 04-03-07 18:44
----------------------------------------------------------------------
You mean ignoring type? I guess this is another example of bug 344
----------------------------------------------------------------------
divan - 04-03-07 19:44
----------------------------------------------------------------------
No, i think it should be inferring:
Test(_ = false) transforms to Test (_ : bool = false) //now it is so
Test(_ = 1s) transforms to Test (_ : short = 1s) //now it's doesn't work
due to 344
Test(_ : int = 1s) //should work too
----------------------------------------------------------------------
nazgul - 04-03-07 21:31
----------------------------------------------------------------------
Fixed on trunk (r7578) - we have both, better message and proper handling
of strongly typed literals.
Issue History
Date Modified Username Field Change
======================================================================
04-02-07 00:30 VladD2 New Issue
04-03-07 18:09 divan Note Added: 0001831
04-03-07 18:12 divan Note Edited: 0001831
04-03-07 18:44 nazgul Note Added: 0001832
04-03-07 19:44 divan Note Added: 0001833
04-03-07 21:31 nazgul Status new => resolved
04-03-07 21:31 nazgul Resolution open => fixed
04-03-07 21:31 nazgul Assigned To => nazgul
04-03-07 21:31 nazgul Note Added: 0001836
======================================================================
More information about the bugs
mailing list