[nem-bug] [Nemerle 0000743]: Nemerle Ices on .ctor with default
parameter when classname is same as already imported
feedback at nemerle.org
feedback at nemerle.org
Wed Nov 29 16:11:09 CET 2006
The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=743>
======================================================================
Reported By: Snaury
Assigned To: malekith
======================================================================
Project: Nemerle
Issue ID: 743
Category: Compiler
Reproducibility: always
Severity: major
Priority: normal
Status: resolved
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 08-18-2006 20:13 CEST
Last Modified: 11-29-2006 16:11 CET
======================================================================
Summary: Nemerle Ices on .ctor with default parameter when
classname is same as already imported
Description:
// 1.n
using Nemerle.IO;
using Nemerle.Text;
using System;
using System.IO;
public class FileInfo
{
public mutable sedname : string;
public mutable sedpart : string;
public mutable fullname : string;
public mutable used : bool;
public this(name : string, full : string = "none") {
regexp match(name) {
| @"(?i)(?<part>[a-z]+\.\d{2}\.\d{2}\.\d{1})\..*" =>
sedpart = part;
sedname = name;
fullname = full;
used = false;
| _ =>
throw Exception($"Unable to depict SED Name format: $(name)");
}
}
}
def fi = FileInfo("SomeBank.15.01.1.f.r");
// nbuild 1.n
ncc.exe -no-color -out:1.exe 1.n
1.n:26:10:26:18: 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 ``False'' failed in file
typing/Typer-OverloadSelection.n, line 127:
method FileInfo..ctor(name : string, full : string) : void==[string,
<null>] != method System.IO.FileInfo..ctor(fileName : string) :
void==[string]
at Nemerle.Compiler.Typer.IsBetterOverload(OverloadPossibility o1,
OverloadPossibility o2)
at
Nemerle.Compiler.Typer._N__N_method_lambda_67330.apply(OverloadPossibility
_N_67328, OverloadPossibility _N_67329)
at Nemerle.Compiler.Typer._N__N_l67558_67599`1.apply('a _N_67598)
at Nemerle.Collections.List.Exists['a](list`1 l, Function`2 f)
at Nemerle.Compiler.Typer._N__N_l67552_67579`1.apply('a _N_67577,
list`1 _N_67578)
at Nemerle.Collections.List.FoldLeft['a,'b](list`1 l, 'b acc,
Function`3 f)
at Nemerle.Compiler.Typer.GetBestOverloads(list`1 parms)
at Nemerle.Compiler.Typer.DelayedTyping.ResolveOverload(list`1
overloads, list`1 parms, TyVar expected)
at Nemerle.Compiler.Typer.DelayedTyping.DoResolve()
at Nemerle.Compiler.Typer.DelayedTyping.Resolve()
at Nemerle.Compiler.Typer.TypeCall(PExpr fnc, list`1 parms, TyVar
expected, Boolean is_property)
at Nemerle.Compiler.Typer.DoType(PExpr expression, TyVar expected,
Boolean is_toplevel_in_seq)
at Nemerle.Compiler.Typer.TypeExpr(PExpr e, TyVar expected, Boolean
is_toplevel_in_seq)
at Nemerle.Compiler.Typer.TypeLocalDefinition(Boolean is_mutable, Name
name, PExpr val)
at Nemerle.Compiler.Typer.DoType(PExpr expression, TyVar expected,
Boolean is_toplevel_in_seq)
at Nemerle.Compiler.Typer.TypeExpr(PExpr e, TyVar expected, Boolean
is_toplevel_in_seq)
at Nemerle.Compiler.Typer.DoType(PExpr expression, TyVar expected,
Boolean is_toplevel_in_seq)
at Nemerle.Compiler.Typer.TypeExpr(PExpr e, TyVar expected, Boolean
is_toplevel_in_seq)
at Nemerle.Compiler.Typer.RunTyper()
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_25320.apply_void(TypeBuilder
_N_25319)
at
Nemerle.Compiler.TypesManager._N_maybe_f_25771.apply_void(TypeBuilder
_N_25770)
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_l24898_24989.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()
error: child process exited abnormally
... while compiling 1.n
======================================================================
----------------------------------------------------------------------
malekith - 11-29-06 15:53
----------------------------------------------------------------------
Simpler example:
public class A
{
public this (_ : string) { }
public this (_ : string, _ = "a") { }
}
_ = A("s");
Working on it...
----------------------------------------------------------------------
malekith - 11-29-06 16:11
----------------------------------------------------------------------
Resolved on trunk, r7018
It now gives ambiguity error. There is no such thing as global name hiding
in Nemerle, so if it cannot be resolved through overloading resolution
rules it yields an error.
The rule for choosing overloads when default parameters are present is
(now) to ignore default parameters.
Issue History
Date Modified Username Field Change
======================================================================
08-18-06 20:13 Snaury New Issue
08-18-06 21:47 Snaury Severity crash => major
08-18-06 21:47 Snaury Description Updated
11-29-06 15:53 malekith Note Added: 0001533
11-29-06 16:11 malekith Status new => resolved
11-29-06 16:11 malekith Resolution open => fixed
11-29-06 16:11 malekith Assigned To => malekith
11-29-06 16:11 malekith Note Added: 0001534
======================================================================
More information about the bugs
mailing list