Using this test, nicec crashes.
file:
<T> Iterator<!T> forIterator(void->?T gen){
return [].iterator();
}
void->?String lines(){
return ()=> "";
}
void main(String[] args){
for(line:lines()){}
}
Output:
nice.lang: parsing
bug: parsing
bug: 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" bossa.util.InternalError:
panic: assertion failed:
at bossa.util.Internal.error(Internal.java:86)
at mlsub.typing.lowlevel.S.panic(S.java:79)
at mlsub.typing.lowlevel.S.assume(S.java:101)
at mlsub.typing.lowlevel.S.assume(S.java:97)
at
mlsub.typing.lowlevel.DomainVector.reduce(DomainVector.java:65)
at
mlsub.typing.lowlevel.K0.reduceDomain(K0.java:846)
at mlsub.typing.lowlevel.K0.leq0(K0.java:695)
at mlsub.typing.lowlevel.K0.leq(K0.java:653)
at
mlsub.typing.lowlevel.Engine$Constraint.leq(Engine.java:983)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:265)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:232)
at mlsub.typing.Variance.leq(Variance.java:198)
at mlsub.typing.Variance.leq(Variance.java:190)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:265)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:232)
at
mlsub.typing.NullnessKind.leq(NullnessKind.java:113)
at
mlsub.typing.NullnessKind.leq(NullnessKind.java:89)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:265)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:232)
at
mlsub.typing.FunTypeKind.leq(FunTypeKind.java:76)
at
mlsub.typing.FunTypeKind.leq(FunTypeKind.java:67)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:265)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:232)
at
mlsub.typing.NullnessKind.leq(NullnessKind.java:113)
at
mlsub.typing.NullnessKind.leq(NullnessKind.java:89)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:265)
at
mlsub.typing.lowlevel.Engine.leq(Engine.java:232)
at mlsub.typing.Typing.leq(Typing.java:355)
at
mlsub.typing.MonotypeLeqCst.enter(MonotypeLeqCst.java:58)
at
mlsub.typing.Constraint.enter(Constraint.java:297)
at
mlsub.typing.Constraint.enter(Constraint.java:308)
at
bossa.syntax.fun.ensureMonomorphic(tools.nice:78)
at
bossa.syntax.dispatch.ensureMonomorphic(Unknown Source)
at bossa.syntax.fun.typecheck(typecheck.nice:831)
at bossa.syntax.dispatch.typecheck(Unknown Source)
at bossa.syntax.fun.lambda28(Unknown Source)
at bossa.syntax.fun.apply1(Unknown Source)
at
gnu.expr.ModuleMethod.apply1(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:141)
at nice.lang.dispatch.foreach(Unknown Source)
at bossa.syntax.fun.typecheck(typecheck.nice:802)
at bossa.syntax.dispatch.typecheck(Unknown Source)
at
bossa.syntax.fun.innerTypecheck(defaultMethod.nice:100)
at
bossa.syntax.DefaultMethodImplementation.innerTypecheck(defaultMethod.nice)
at
bossa.syntax.fun.innerTypecheck(defaultMethod.nice:28)
at
bossa.syntax.MethodDeclaration.innerTypecheck(methodDeclaration.nice)
at
bossa.syntax.fun.typecheck(methodDeclaration.nice:161)
at
bossa.syntax.MethodDeclaration.typecheck(methodDeclaration.nice)
at bossa.syntax.Node.doTypecheck(Node.java:299)
at bossa.syntax.Node.doTypecheck(Node.java:304)
at bossa.syntax.Node.doTypecheck(Node.java:304)
at bossa.syntax.fun.typechecking(ast.nice:146)
at bossa.syntax.CAST.typechecking(ast.nice)
at
bossa.modules.Package.typecheck(Package.java:369)
at mlsub.compilation.fun.lambda25(Unknown Source)
at mlsub.compilation.fun.apply1(Unknown Source)
at
gnu.expr.ModuleMethod.apply1(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:141)
at nice.lang.dispatch.foreach(Unknown Source)
at
mlsub.compilation.fun.compileComponent(make.nice:29)
at
mlsub.compilation.dispatch.compileComponent(Unknown Source)
at mlsub.compilation.fun$make.lambda24(Unknown
Source)
at mlsub.compilation.fun$make.apply1(Unknown
Source)
at
gnu.expr.ModuleMethod.apply1(ModuleMethod.java:89)
at nice.lang.fun.foreach(collections.nice:141)
at nice.lang.dispatch.foreach(Unknown Source)
at mlsub.compilation.fun.make(make.nice:44)
at mlsub.compilation.dispatch.make(Unknown Source)
at
nice.tools.compiler.fun.compile(interface.nice:40)
at nice.tools.compiler.dispatch.compile(Unknown
Source)
at
nice.tools.compiler.console.fun.compile(main.nice:170)
at
nice.tools.compiler.console.dispatch.compile(Unknown
Source)
at
nice.tools.compiler.console.fun.main(main.nice:204)
at
nice.tools.compiler.console.dispatch.main(Unknown Source)
Logged In: YES
user_id=929365
If I change it to <T> Iterator<!T> forIterator(void->T gen),
then it works fine.