[nem-bug] [Nemerle 0000693]: type inference fails when concatenating list comprehensions

feedback at nemerle.org feedback at nemerle.org
Mon Dec 4 18:04:24 CET 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=693> 
======================================================================
Reported By:                aleksey
Assigned To:                malekith
======================================================================
Project:                    Nemerle
Issue ID:                   693
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             06-24-2006 00:29 CEST
Last Modified:              12-04-2006 18:04 CET
======================================================================
Summary:                    type inference fails when concatenating list
comprehensions
Description: 
Type inference fails on infamous haskell "quicksort" example:

def quicksort(l)
{
	| [] => []
	| x :: xs =>
		quicksort($[y | y in xs, y<x])
		+ [x]
		+ quicksort($[y | y in xs, y>=x])
}
System.Console.WriteLine(quicksort([2,1,3])

quicksort.n: cannot find the operator `op_GreaterThanOrEqual' on ? and
 System.Object+

When rewritten the following way, it successfully compiles and works:
def quicksort(l)
{
	| [] => []
	| x :: xs =>
		def lo = quicksort($[y | y in xs, y<x]);
		def hi = quicksort($[y | y in xs, y>=x]);
		lo + [x] + hi
}
======================================================================

----------------------------------------------------------------------
 malekith - 12-04-06 18:04 
----------------------------------------------------------------------
Resolved on trunk, r7045

Issue History
Date Modified  Username       Field                    Change              
======================================================================
06-24-06 00:29 aleksey        New Issue                                    
12-04-06 18:04 malekith       Status                   new => resolved     
12-04-06 18:04 malekith       Resolution               open => fixed       
12-04-06 18:04 malekith       Assigned To               => malekith        
12-04-06 18:04 malekith       Note Added: 0001556                          
======================================================================




More information about the bugs mailing list