[nem-bug] [Nemerle 0000573]: evil error messages for unconstrained IComparable['a]

feedback at nemerle.org feedback at nemerle.org
Wed Dec 13 15:46:10 CET 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=573> 
======================================================================
Reported By:                malekith
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   573
Category:                   Compiler (type engine)
Reproducibility:            always
Severity:                   minor
Priority:                   high
Status:                     confirmed
======================================================================
Date Submitted:             11-20-2005 11:44 CET
Last Modified:              12-13-2006 15:46 CET
======================================================================
Summary:                    evil error messages for unconstrained
IComparable['a]
Description: 
  	
class A {
}

def x = Nemerle.Collections.Heap (1);
x.Add (A());

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

----------------------------------------------------------------------
 nazgul - 12-06-06 19:39 
----------------------------------------------------------------------
The another, more ugly example taken from
http://nemerle.org/bugs/view.php?id=646

using System;

// Simple parent class, implementing IComparable
public class Entity : IComparable[Entity] {
  public CompareTo( _e : Entity ) : int { 0 }
}

public class DefContainsImpl['a]
  where 'a : Entity, IComparable ['a] {}


// A couple of subclasses
public class Item : Entity {
  public this () {
    def _things1 = DefContainsImpl();
  }
}

----------------------------------------------------------------------
 malekith - 12-13-06 15:46 
----------------------------------------------------------------------
Both http://nemerle.org/bugs/view.php?id=646 and this one seem to be caused by
the same flaw -- we construct
intersection type T = IComparable[T] AND Entity, which should really be
Entity (and therefore avoid the cycle). We do it, because at that point we
do not yet know, that Entity <: IComparable[Entity] (it's before that
relation is processed).

Issue History
Date Modified  Username       Field                    Change              
======================================================================
11-20-05 11:44 malekith       New Issue                                    
05-12-06 21:20 nazgul         Status                   new => confirmed    
05-12-06 21:20 nazgul         Summary                  evil error messages for
unconstrained IComparable['a] => evil error messages for unconstrained
IComparable[\'a]
05-12-06 21:20 nazgul         Description Updated                          
05-12-06 21:20 nazgul         Additional Information Updated                    
12-06-06 19:39 nazgul         Note Added: 0001566                          
12-13-06 15:46 malekith       Note Added: 0001580                          
======================================================================




More information about the bugs mailing list