[nem-bug] [Nemerle 0000641]: Compiler crash due to recursive local functions in a generic class method

feedback at nemerle.org feedback at nemerle.org
Sat Apr 1 10:02:16 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=641> 
======================================================================
Reported By:                amp
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   641
Category:                   Compiler
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             04-01-2006 06:51 CEST
Last Modified:              04-01-2006 10:02 CEST
======================================================================
Summary:                    Compiler crash due to recursive local functions in a
generic class method
Description: 
The compiler crashs with "System.InvalidOperationException: can only be
called in generic type" when a recursive local function in a generic class
method uses functions on an object whose type is a generic parameter. See
the attached code.

Tested with SVN on March 30, 2006 on a recent Ubuntu Dapper. 

Mono --version outputs:

Mono JIT compiler version 1.1.13.4, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal

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

----------------------------------------------------------------------
 nazgul - 04-01-06 10:02 
----------------------------------------------------------------------
It crashes also on MS.NET:

t.n:21:1:34:2: warning: matching is not exhaustive, example unmatched
value: Nil
error: internal compiler error: got ArgumentException (The specified
method cannot be dynamic or global and must be declared on a generic type
definition.
Parameter name: method)
   at System.Reflection.Emit.TypeBuilder.GetMethod(Type type, MethodInfo
method)
   at Nemerle.Compiler.ILEmitter.workaround_mono_bug(TypeBuilder type_) in
C:\cygwin\home\nazgul\nemerle\ncc\generation\ILEmitter.n:line 84
   at Nemerle.Compiler.ILEmitter..ctor(ConstructorBuilder
constructor_builder, TypeBuilder type_, Fun_header fun_header) in
C:\cygwin\home\nazgul\nemerle\ncc\generation\ILEmitter.n:line 129
   at Nemerle.Compiler.MethodBuilder._N__N_l28840_28972.apply_void() in
C:\cygwin\home\nazgul\nemerle\ncc\generation\HierarchyEmitter.n:line 730
   at Nemerle.Compiler.TypeBuilder.FinalizeType() in
C:\cygwin\home\nazgul\nemerle\ncc\hierarchy\TypeBuilder.n:line 1594
   at Nemerle.Compiler.TypeBuilder.EmitImplementation() in
C:\cygwin\home\nazgul\nemerle\ncc\generation\HierarchyEmitter.n:line 566
   at Nemerle.Compiler.TypeBuilder._N__N_l27968_27990.apply_void() in
C:\cygwin\home\nazgul\nemerle\ncc\hierarchy\TypeBuilder.n:line 508
   at Nemerle.Compiler.Solver.Enqueue(FunctionVoid action) in
C:\cygwin\home\nazgul\nemerle\ncc\typing\Solver.n:line 198
   at Nemerle.Compiler.TypesManager.EmitDecls() in
C:\cygwin\home\nazgul\nemerle\ncc\generation\HierarchyEmitter.n:line 191
   at Nemerle.Compiler.Passes.Run() in
C:\cygwin\home\nazgul\nemerle\ncc\passes.n:line 225
   at Nemerle.CommandlineCompiler.MainClass.main_with_catching() in
C:\cygwin\home\nazgul\nemerle\ncc\main.n:line 83

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-01-06 06:51 amp            New Issue                                    
04-01-06 06:51 amp            File Added: Generics1.n                      
04-01-06 10:02 nazgul         Note Added: 0001133                          
======================================================================




More information about the bugs mailing list