[nem-bug] [Nemerle 0000690]: ncc: assertion failed in file ncc\typing\Typer.n, line 149

feedback at nemerle.org feedback at nemerle.org
Mon Nov 27 11:42:07 CET 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=690> 
======================================================================
Reported By:                VladD2
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   690
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             06-04-2006 21:14 CEST
Last Modified:              11-27-2006 11:42 CET
======================================================================
Summary:                    ncc: assertion failed in file ncc\typing\Typer.n,
line 149
Description: 
using System.Console;

[Record]
class Expr { }
[Record]
class Lit : Expr { }
[Record]
class Add : Expr { public Left : Expr; public Right : Expr; }
[Record]
class Neg : Expr { public Expr : Expr; }
[Record]
class IntLit : Lit { public Value : int; }
[Record]
class DoubleLit : Lit { public Value : double; }


module Program
{
  DescendantPrint : Expr -> bool = null;
  
  public Print(expr : Expr) : void
  {
    when (DescendantPrint != null && DescendantPrint(expr))
      match (expr)
      { | add is Add          => Print(add.Left); Write(" + ");
Print(add.Right);
        | neg is Neg          => Write("-("); Print(neg.Expr);
Write(")");
        | intLit is IntLit    => Write(intLit.Value);
        | dblLit is DoubleLit => Write(dblLit.Value);
        | _                   => Write("<uncnown>");
      }
  }

  static Main() : void
  {
  }
}

TheExprProblem-3.n:23:10:23:35: 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
ncc\typing\Typer.n, line 149:
hidden errors compiling method Program.Print(expr : Expr) : void
   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_26248.apply_void(TypeBuilder
_N_26247)
   at
Nemerle.Compiler.TypesManager._N_maybe_f_26695.apply_void(TypeBuilder
_N_26694)
   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_l25825_25916.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 - 07-06-06 23:57 
----------------------------------------------------------------------
A simpler example

module Program
{
  DescendantPrint : string -> bool = null;
  
  public Print() : void
  {
    when (DescendantPrint != null)
      ()
  }

  static Main() : void
  {
  }
}

----------------------------------------------------------------------
 malekith - 11-27-06 11:42 
----------------------------------------------------------------------
The problem is that DescendantPrint is not mutable and it therefore
threated as a literal. We cannot handle null literals with the type
constrained. I'm fixing it right now.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
06-04-06 21:14 VladD2         New Issue                                    
07-06-06 23:57 nazgul         Note Added: 0001354                          
11-27-06 11:42 malekith       Note Added: 0001524                          
======================================================================




More information about the bugs mailing list