[nem-bug] [Nemerle 0000875]: StackOverflowException inside ncc, if there is a circular depenedcy in source

feedback at nemerle.org feedback at nemerle.org
Mon Feb 5 22:48:58 CET 2007


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=875> 
======================================================================
Reported By:                nikov
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   875
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             02-05-2007 16:36 CET
Last Modified:              02-05-2007 22:48 CET
======================================================================
Summary:                    StackOverflowException inside ncc, if there is a
circular depenedcy in source
Description: 
module A{
	public Foo[T,S](x : T) : void where T : S where S : T {
        _ = x.Foo()
    }
}
======================================================================

----------------------------------------------------------------------
 nazgul - 02-05-07 20:22 
----------------------------------------------------------------------
We need a graph cycle detection algorithm here. Any volunteers?

----------------------------------------------------------------------
 VladD2 - 02-05-07 22:42 
----------------------------------------------------------------------
Maybe simply add all dependency in Hashtable? If some exists in Hashtable
thin we have cycle.

----------------------------------------------------------------------
 nazgul - 02-05-07 22:48 
----------------------------------------------------------------------
No, this must be full-featured graph traversal check:

class A [x,y,z,w] : where x : y where y : z where w : z, w : x { }  // OK

class A [x,y,z,w] : where x : y where y : z where w : z where z : y { } 
// ERROR

The algorithm is simple: 
- create graph with parameters as nodes
- fill it by constraints as edges
- traverse it using DFS detecting cycles

But having a (generic) graph component would be nice.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
02-05-07 16:36 nikov          New Issue                                    
02-05-07 20:22 nazgul         Note Added: 0001693                          
02-05-07 22:42 VladD2         Note Added: 0001694                          
02-05-07 22:48 nazgul         Note Added: 0001695                          
======================================================================




More information about the bugs mailing list