[nem-bug] [Nemerle 0000773]: match and type inference

feedback at nemerle.org feedback at nemerle.org
Wed Nov 8 22:27:36 CET 2006


The following issue has been CONFIRMED.
======================================================================
<http://nemerle.org/bugs/view.php?id=773> 
======================================================================
Reported By:                IT
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   773
Category:                   Compiler
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     confirmed
======================================================================
Date Submitted:             10-02-2006 01:00 CEST
Last Modified:              11-08-2006 22:27 CET
======================================================================
Summary:                    match and type inference
Description: 
I am not sure this is a bug, but looks like that.

public variant Var
{
  | Opt
}

public module Program
{
  Main() : void
  {
    def boo1(v : Var)
    {
      | Opt => () // ok
    }

    def boo2(v)
    {
      | Opt => () // error: unbound type name Opt
    }

    boo1(Var.Opt());
    boo2(Var.Opt());
  }
}
======================================================================

----------------------------------------------------------------------
 malekith - 10-02-06 10:29 
----------------------------------------------------------------------
It's a lack of fetaure ;-)

The problem is that typing of matching is not delayed. Therefore it needs
more type information than, say, member access. 

One can enforce the parameter type, the type of matched value or use
Var.Opt for matching, but you probably already know that.

It would be nice to implement this though :-)

Issue History
Date Modified  Username       Field                    Change              
======================================================================
10-02-06 01:00 IT             New Issue                                    
10-02-06 10:29 malekith       Note Added: 0001466                          
11-08-06 22:27 malekith       Severity                 minor => feature    
11-08-06 22:27 malekith       Status                   new => confirmed    
11-08-06 22:27 malekith       Description Updated                          
======================================================================




More information about the bugs mailing list