[nem-bug] [Nemerle 0000761]: Wrong erroe message (MatchFailureException instead InvalidProgramException)

feedback at nemerle.org feedback at nemerle.org
Thu Sep 21 16:18:19 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=761> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   761
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             09-21-2006 15:12 CEST
Last Modified:              09-21-2006 16:18 CEST
======================================================================
Summary:                    Wrong erroe message (MatchFailureException instead
InvalidProgramException)
Description: 
using System;
using System.Console;
using Nemerle.Utility;

class Test
{
        mutable menus: list[char * string];
        mutable menus2: list[char * string];
        mutable menus3: list[char * string];
     
        public PrintMenus(): void
        {
            menus = ('a', "some a") :: [];
            menus.Iter((c, s) => WriteLine($" $c - $s"));

            menus2 ::= ('a', "some a");
            menus2.Iter((c, s) => WriteLine($" $c - $s"));
 
            menus3 += [('a', "some a")];
            menus3.Iter((c, s) => WriteLine($" $c - $s"));
        }
}

def t = Test();
t.PrintMenus ();


-------------------------------------------------------------------------------
a - some a
 a - some a

Unhandled Exception: Nemerle.Core.MatchFailureException: Exception of type
'Nemerle.Core.MatchFailureException' was thrown.
   at Nemerle.Collections.List.Iter['a](list`1 l, FunctionVoid`1 f) in
D:\MyProjects\RSDN\Nemerle\nemerle\lib\list.n:line 841

   at Nemerle.Core.list`1.Iter(FunctionVoid`1 f) in
D:\MyProjects\RSDN\Nemerle\nemerle\lib\list.n:line 284
   at Test.PrintMenus() in C:\Documents and Settings\VladAdm\Local
Settings\Application Data\Temporary Projects\ConsoleApplic
ation1\Main.n:line 17
   at _N_AutoModule.Main() in C:\Documents and Settings\VladAdm\Local
Settings\Application Data\Temporary Projects\ConsoleApp
lication1\Main.n:line 25
-------------------------------------------------------------------------------


See also: http://nemerle.org/bugs/view.php?id=760
======================================================================

----------------------------------------------------------------------
 Snaury - 09-21-06 16:18 
----------------------------------------------------------------------
My oppinion is that error message is not wrong at all (because when
matching value is not head nor tail, it is null, and thus matching fails
on it). But concerning your bug 760, I think that maybe null should be
treated same as Head (i.e. []) in matching?

Issue History
Date Modified  Username       Field                    Change              
======================================================================
09-21-06 15:12 VladD2         New Issue                                    
09-21-06 16:18 Snaury         Note Added: 0001450                          
======================================================================




More information about the bugs mailing list