[ nice-Bugs-923429 ] compiler failure, table2[key] =
"SourceForge.net" <[email protected]> Thu, 22 Apr 2004 03:16:40 -0700
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #923429, was opened at 2004-03-25 21:18
Message generated for change (Comment added) made by bonniot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=923429&group_id=12788
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Isaac Gouy (igouy)
Assigned to: Daniel Bonniot (bonniot)
Summary: compiler failure, table2[key] =
Initial Comment:
Sorry wasn't obvious how to make this smaller
Nice compiler version 0.9.8 prerelease (build 2004.03.25,
17:17:17 UTC)
void main(String[] args){
var n = 1;
let nKeys = 10000;
let table1 = new HashMap(nKeys);
let table2 = new HashMap();
for (int i = 0; i <= nKeys; i++)
table1["foo_" + i] = new Cell(value: i);
String key;
int v1;
?Cell c2;
while (n-- > 0)
for (each : table1.entrySet) {
key = each.getKey;
v1 = each.getValue.value;
if ( (c2 = table2[key]) != null)
c2.value += v1;
else
table2[key] = new Cell(value: v1); //HERE
}
}
class Cell { int value; }
toString(Cell c) = c.value.toString;
//-----------------------------------------------
\Test>nicec --sourcepath .. -a t.jar test
nice.lang: parsing
test: parsing
test: typechecking
An exception has occured in the compiler
Please fill-in a bug report at the following webpage:
http://sourceforge.net/tracker/?
func=add&group_id=12788&atid=112788
Stack trace:
Exception in thread "main"
java.lang.ArrayIndexOutOfBoundsException: -2
at mlsub.typing.lowlevel.BitMatrix.get
(BitMatrix.java:128)
at mlsub.typing.lowlevel.K0.leq0(K0.java:671)
at mlsub.typing.lowlevel.K0.leq(K0.java:648)
at mlsub.typing.lowlevel.Engine$Constraint.leq
(Engine.java:926)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:263)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:230)
at mlsub.typing.Variance.leq(Variance.java:198)
at mlsub.typing.Variance.leq(Variance.java:190)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:263)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:230)
at mlsub.typing.NullnessKind.leq
(NullnessKind.java:77)
at mlsub.typing.NullnessKind.leq
(NullnessKind.java:68)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:263)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:230)
at mlsub.typing.Variance.assertEq
(Variance.java:251)
at mlsub.typing.Variance.leq(Variance.java:199)
at mlsub.typing.Variance.leq(Variance.java:190)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:263)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:230)
at mlsub.typing.NullnessKind.leq
(NullnessKind.java:77)
at mlsub.typing.NullnessKind.leq
(NullnessKind.java:68)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:263)
at mlsub.typing.lowlevel.Engine.leq
(Engine.java:230)
at mlsub.typing.Typing.leq(Typing.java:355)
at mlsub.typing.MonotypeLeqCst.enter
(MonotypeLeqCst.java:58)
at mlsub.typing.Constraint.enter
(Constraint.java:292)
at mlsub.typing.Constraint.enter
(Constraint.java:281)
at mlsub.typing.Polytype.simplify
(Polytype.java:264)
at mlsub.typing.Polytype.trySimplify
(Polytype.java:310)
at bossa.syntax.CallExp.computeType
(CallExp.java:300)
at bossa.syntax.Expression.getType
(Expression.java:162)
at bossa.syntax.fun.typecheck
(typecheck.nice:204)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:796)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:638)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:544)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:796)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:829)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.typecheck
(typecheck.nice:829)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at bossa.syntax.fun.lambda12(typecheck.nice:714)
at bossa.syntax.fun.apply1(typecheck.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at bossa.syntax.fun.typecheck
(typecheck.nice:712)
at bossa.syntax.dispatch.typecheck(dispatch.nice)
at
bossa.syntax.DefaultMethodImplementation.innerTypeche
ck(DefaultMethodImplementation.java:95)
at
bossa.syntax.NiceMethod$WithDefault.innerTypecheck
(NiceMethod.java:352)
at bossa.syntax.MethodDeclaration.typecheck
(MethodDeclaration.java:205)
at bossa.syntax.Node.doTypecheck
(Node.java:303)
at bossa.syntax.Node.doTypecheck
(Node.java:308)
at bossa.syntax.Node.doTypecheck
(Node.java:308)
at bossa.syntax.AST.typechecking(AST.java:188)
at bossa.modules.Package.typecheck
(Package.java:323)
at mlsub.compilation.fun.lambda18(make.nice:29)
at mlsub.compilation.fun.apply1(make.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at mlsub.compilation.fun.compileComponent
(make.nice:29)
at mlsub.compilation.dispatch.compileComponent
(dispatch.nice)
at mlsub.compilation.fun$make.lambda17
(make.nice:45)
at mlsub.compilation.fun$make.apply1(make.nice:0)
at gnu.expr.ModuleMethod.apply1
(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:121)
at nice.lang.dispatch.foreach(range.nice:0)
at mlsub.compilation.fun.make(make.nice:44)
at mlsub.compilation.dispatch.make(dispatch.nice)
at nice.tools.compiler.fun.compile
(interface.nice:40)
at bossa.modules.Compilation.compile
(Compilation.nice)
at nice.tools.compiler.console.fun.compile
(main.nice:168)
at nice.tools.compiler.console.dispatch.compile
(dispatch.nice)
at nice.tools.compiler.console.fun.main
(main.nice:184)
----------------------------------------------------------------------
Comment By: Daniel Bonniot (bonniot)
Date: 2004-04-22 12:16
Message:
Logged In: YES
user_id=88952
This bug has been fixed. The next release of the compiler will
include this correction. In the mean time, I encourage you try
the development version. It contains a version of the compiler
that fixes the bug. Please try it and reopen the bug-report if
you find any problem with it.
To know how to get an install the development version of the
compiler that fixes this bug, please read
http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/DevelopmentVersion
Note that the bug has first been fixed in the CVS version, and it
might take one or two hours until the development version
includes the fix.
Thanks again for your help by submiting this bug report.
Daniel Bonniot
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=923429&group_id=12788
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click