[nem-bug] [Nemerle 0000857]: Internal Compiler Error
feedback at nemerle.org
feedback at nemerle.org
Wed Oct 24 23:28:16 CEST 2007
The following issue has been ASSIGNED.
======================================================================
<http://nemerle.org/bugs/view.php?id=857>
======================================================================
Reported By: nikov
Assigned To: divan
======================================================================
Project: Nemerle
Issue ID: 857
Category: Compiler
Reproducibility: always
Severity: crash
Priority: normal
Status: assigned
======================================================================
Date Submitted: 01-30-2007 13:22 CET
Last Modified: 10-24-2007 23:28 CEST
======================================================================
Summary: Internal Compiler Error
Description:
I tried to compile the following:
[nemerle]
using System;
struct A
{
static Foo() : void {
def x = A
}
}
()
[/nemerle]
and got Internal Compiler Error:
[output]
error : internal compiler error: got some unknown exception of type
System.InvalidCastException: Unable to cast object of type 'Fun' to type
'Class'.
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 864
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 123
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 1165
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 123
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 1340
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr) in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 123
at Nemerle.Compiler.Typer2.Run() in
C:\Nemerle\Compiler\ncc\typing\Typer2.n:line 98
at Nemerle.Compiler.Typer.RunSecondPass(MethodBuilder meth) in
C:\Nemerle\Compiler\ncc\typing\Typer.n:line 367
at Nemerle.Compiler.Typer..ctor(MethodBuilder m) in
C:\Nemerle\Compiler\ncc\typing\Typer.n:line 168
at Nemerle.Compiler.CompilerComponentsFactory.CreateTyper(MethodBuilder
m) in C:\Nemerle\Compiler\ncc\misc\ComponentsFactory.n:line 33
at Nemerle.Compiler.MethodBuilder.RunBodyTyper() in
C:\Nemerle\Compiler\ncc\hierarchy\ClassMembers.n:line 816
at Nemerle.Compiler.MethodBuilder.Compile() in
C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line 972
at Nemerle.Compiler.TypeBuilder.EmitImplementation() in
C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line 564
at
Nemerle.Compiler.TypesManager._N_emit_impl_35999.apply_void(TypeBuilder
_N_35998) in C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line
316
at
Nemerle.Compiler.TypesManager._N__N_l36634_36652.apply_void(TypeBuilder
_N_36651) in C:\Nemerle\Compiler\ncc\hierarchy\TypesManager.n:line 249
at
Nemerle.Compiler.TypesManager._N_maybe_f_36605.apply_void(TypeBuilder
_N_36604) in C:\Nemerle\Compiler\ncc\hierarchy\TypesManager.n:line 225
at Nemerle.Collections.List.Iter['a](list`1 l, FunctionVoid`1 f) in
C:\Nemerle\Compiler\lib\list.n:line 906
at Nemerle.Core.list`1.Iter(FunctionVoid`1 f) in
C:\Nemerle\Compiler\lib\list.n:line 307
at Nemerle.Compiler.TypesManager.Iter(list`1 builders, FunctionVoid`1
f) in C:\Nemerle\Compiler\ncc\hierarchy\TypesManager.n:line 231
at Nemerle.Compiler.TypesManager.IterConditionally(FunctionVoid`1 f,
Function`2 cond) in C:\Nemerle\Compiler\ncc\hierarchy\TypesManager.n:line
247
at Nemerle.Compiler.TypesManager.compile_all_tyinfos(Boolean aux_phase)
in C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line 335
at Nemerle.Compiler.TypesManager._N__N_l35432_35535.apply_void() in
C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line 205
at Nemerle.Compiler.Solver.Enqueue(FunctionVoid action) in
C:\Nemerle\Compiler\ncc\typing\Solver.n:line 197
at Nemerle.Compiler.TypesManager.EmitDecls() in
C:\Nemerle\Compiler\ncc\generation\HierarchyEmitter.n:line 204
at Nemerle.Compiler.ManagerClass.Run() in
C:\Nemerle\Compiler\ncc\passes.n:line 432
at Nemerle.CommandlineCompiler.MainClass.main_with_catching() in
C:\Nemerle\Compiler\ncc\main.n:line 86
[/output]
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
related to 0000897 ICE on "int.ToString ()"
======================================================================
----------------------------------------------------------------------
nikov - 01-30-07 14:11
----------------------------------------------------------------------
The following source code produces the same error:
[nemerle]
_ = int
[/nemerle]
----------------------------------------------------------------------
nazgul - 02-02-07 20:07
----------------------------------------------------------------------
This patch fixes the ICE, but in result we get incorrect code generated:
Index: typing/Typer2.n
===================================================================
--- typing/Typer2.n (revision 7365)
+++ typing/Typer2.n (working copy)
@@ -861,7 +861,11 @@
| TExpr.ImplicitValueTypeCtor =>
- MarkAsUsed ((expr.MType :> MType.Class).tycon, expr.Location);
+ match (expr.MType) {
+ | Class (tycon, _)
+ | Fun (_, MType.Class (tycon, _)) => MarkAsUsed (tycon,
expr.Location)
+ | t => Util.ice ($"unexpected type $t")
+ }
null
Issue History
Date Modified Username Field Change
======================================================================
01-30-07 13:22 nikov New Issue
01-30-07 14:11 nikov Note Added: 0001660
02-02-07 20:07 nazgul Note Added: 0001667
03-27-07 20:16 divan Relationship added related to 0000897
10-24-07 19:04 divan Issue Monitored: divan
10-24-07 23:28 divan Status new => assigned
10-24-07 23:28 divan Assigned To => divan
======================================================================
More information about the bugs
mailing list