[nem-bug] [Nemerle 0000717]: Can't match array

feedback at nemerle.org feedback at nemerle.org
Mon Jul 24 00:18:47 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=717> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   717
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-14-2006 02:41 CEST
Last Modified:              07-24-2006 00:18 CEST
======================================================================
Summary:                    Can't match array
Description: 
def seq : System.Collections.Generic.IEnumerable[int] = array[1,2,3];

def f(seq)
{
  | ary is array[int] => System.Console.WriteLine("Is array!")
  | _                 => System.Console.WriteLine("Is NOT array.")
}

f (seq);

===============================================
Main.n(5,5,5,17): error : invalid type in (x : type) pattern: array [int]
Main.n(6,5,6,6): warning : this match clause is unused
Main.n(9,1,9,2): error : in argument http://nemerle.org/bugs/view.php?id=1 (seq)
of f, needed a array [int]-,
got System.Collections.Generic.IEnumerable[int]: common super type of types
[array [int], System.Collections.Generic.IEnumerable[int]] is just
`object', please upcast one of the types to `object' if this is desired

======================================================================

----------------------------------------------------------------------
 nazgul - 07-24-06 00:18 
----------------------------------------------------------------------
This is partially fixed on trunk (r6466). Matching against object works,
but IEnumerable confuses the typer.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
07-14-06 02:41 VladD2         New Issue                                    
07-24-06 00:18 nazgul         Note Added: 0001376                          
======================================================================




More information about the bugs mailing list