[nem-bug] [Nemerle 0000734]: Inernal compiler error in foreach in nested function

feedback at nemerle.org feedback at nemerle.org
Fri Nov 10 19:33:05 CET 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=734> 
======================================================================
Reported By:                Snaury
Assigned To:                nazgul
======================================================================
Project:                    Nemerle
Issue ID:                   734
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             08-11-2006 14:37 CEST
Last Modified:              11-10-2006 19:33 CET
======================================================================
Summary:                    Inernal compiler error in foreach in nested function
Description: 
This code:

using System.Collections.Generic;

def merge_dict(to, from)
{
  foreach(kv in from) {
    def inner(to, from) {
      foreach(kv in from) {
        to[kv.Key] = kv.Value;
      }
    }
    inner(to[kv.Key], kv.Value);
  }
}

def dict1 : Dictionary[string,Dictionary[string,string*string]] =
Dictionary();
def dict2 : Dictionary[string,Dictionary[string,string*string]] =
Dictionary();
merge_dict(dict1, dict2);

Produces:

ncc.exe -no-color -out:dict.exe dict.n
dict.n:7:7:7:14: debug: Internal compiler error, please report a bug to
bugs.nemerle.org. You can try modifying program near this location.
error: internal compiler error: assertion failed in file typing/Typer2.n,
line 198:
unresolved expression: delayed macro
   at Nemerle.Compiler.Typer2.Unfold(TExpr expr)
   at Nemerle.Compiler.Typer2.PushConversionDown(TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
   at Nemerle.Compiler.Typer2.Run()
   at Nemerle.Compiler.Typer..ctor(MethodBuilder m)
   at Nemerle.Compiler.MethodBuilder.RunBodyTyper()
   at Nemerle.Compiler.MethodBuilder.Compile()
   at Nemerle.Compiler.TypeBuilder.EmitImplementation()
   at
Nemerle.Compiler.TypesManager._N_emit_impl_25082.apply_void(TypeBuilder
_N_25081)
   at
Nemerle.Compiler.TypesManager._N_maybe_f_25536.apply_void(TypeBuilder
_N_25535)
   at Nemerle.Collections.List.Iter['a](list`1 l, FunctionVoid`1 f)
   at Nemerle.Core.list`1.Iter(FunctionVoid`1 f)
   at Nemerle.Compiler.TypesManager.Iter(list`1 builders, FunctionVoid`1
f)
   at Nemerle.Compiler.TypesManager.compile_all_tyinfos(Boolean
aux_phase)
   at Nemerle.Compiler.TypesManager._N__N_l24660_24751.apply_void()
   at Nemerle.Compiler.Solver.Enqueue(FunctionVoid action)
   at Nemerle.Compiler.TypesManager.EmitDecls()
   at Nemerle.Compiler.ManagerClass.Run()
   at Nemerle.CommandlineCompiler.MainClass.main_with_catching()
======================================================================

----------------------------------------------------------------------
 nazgul - 11-10-06 19:33 
----------------------------------------------------------------------
Looks like it was fixed by recent Michal's delayed-typing patch.
Added testcase (r6863)

Issue History
Date Modified  Username       Field                    Change              
======================================================================
08-11-06 14:37 Snaury         New Issue                                    
11-10-06 19:33 nazgul         Status                   new => resolved     
11-10-06 19:33 nazgul         Resolution               open => fixed       
11-10-06 19:33 nazgul         Assigned To               => nazgul          
11-10-06 19:33 nazgul         Note Added: 0001503                          
======================================================================




More information about the bugs mailing list