[nem-bug] [Nemerle 0000561]: Compiler internal error when defining
nested generic tree
feedback at nemerle.org
feedback at nemerle.org
Sun Nov 6 20:08:23 CET 2005
The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=561>
======================================================================
Reported By: gildur
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 561
Category: Compiler
Reproducibility: always
Severity: crash
Priority: normal
Status: new
======================================================================
Date Submitted: 11-06-2005 20:08 CET
Last Modified: 11-06-2005 20:08 CET
======================================================================
Summary: Compiler internal error when defining nested generic
tree
Description:
While trying to compile following code:
-----
using System;
public class Set['a] where 'a : IComparable['a]
{
private variant Tree['a] where 'a : IComparable['a]
{
| Node
{
left : Tree['a];
elem : 'a;
right : Tree['a];
}
| Null
public Insert(x : 'a) : Tree['a]
{
match (this) {
| Node(l, cur, r) when x.CompareTo(cur) < 0 =>
Node(l.Insert(x), cur, r)
| Node(l, cur, r) when x.CompareTo(cur) > 0 =>
Node(l, cur, r.Insert(x))
| Node(_, _, _) =>
throw ArgumentException(
"Element already exists in the tree");
| Null =>
Node(Null(), x, Null())
}
}
}
private mutable storage : Tree['a] = Tree.Null();
public Add(x : 'a) : void
{
storage = storage.Insert(x);
}
}
-----
I got:
error: internal compiler error: got ArgumentException (node already in the
tree)in <0x003b6> Nemerle.Collections.Tree:_N_insert8367[TypeInfo]
(Nemerle.Collections._N_closure8357`1 _N_Insert_cp8366,
Nemerle.Collections.Node`1 tree)
[...]
I'm using version 0.9.1 of the compile from unix binary installer.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
11-06-05 20:08 gildur New Issue
======================================================================
More information about the bugs
mailing list