Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler bug when spread operator is used twice #1831

Closed
jpragey opened this issue Sep 29, 2014 · 0 comments
Closed

Compiler bug when spread operator is used twice #1831

jpragey opened this issue Sep 29, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@jpragey
Copy link

jpragey commented Sep 29, 2014

The following code:

class A(){}
class B(){shared String qname() => "";}

void f(B[] bs) {
    value v = bs *.qname()*.size;
}

breaks the compiler:

error: compiler bug: null at com.redhat.ceylon.compiler.java.codegen.ExpressionTransformer.transformSpreadOperator(ExpressionTransformer.java:3507)
error: compiler bug: visitor didn't yield any result at com.redhat.ceylon.compiler.java.codegen.ExpressionTransformer.transformExpression(ExpressionTransformer.java:313)
error: compiler bug: visitor didn't yield any result at unknown
Note: Created module bug/1.0.0
ceylon compile: Fatal error: The compiler exited abnormally (4) due to a bug in
the compiler.
Please report it:
 https://github.com/ceylon/ceylon-compiler/issues/new
Please include:

* the stacktrace printed above
* the stacktrace printed below
* a description of what you were trying to compile.

Thank you!
com.redhat.ceylon.compiler.CompilerBugException: Codegen Bug
    at com.redhat.ceylon.compiler.CeylonCompileTool.handleExitCode(CeylonCompileTool.java:472)
    at com.redhat.ceylon.compiler.CeylonCompileTool.run(CeylonCompileTool.java:454)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:352)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:291)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:104)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:37)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:30)
    at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:23)
Caused by: java.lang.RuntimeException: Error generating bytecode for source/bug/run.ceylon
    at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCodeUnlessError(LanguageCompiler.java:765)
    at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCode(LanguageCompiler.java:705)
    at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1450)
    at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.generate(LanguageCompiler.java:816)
    at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1418)
    at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:871)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:829)
    at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.compile(LanguageCompiler.java:227)
    at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:650)
    at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:566)
    at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:556)
    at com.redhat.ceylon.compiler.CeylonCompileTool.run(CeylonCompileTool.java:453)
    ... 10 more
Caused by: java.lang.AssertionError
    at com.sun.tools.javac.util.Assert.error(Assert.java:126)
    at com.sun.tools.javac.tree.JCTree$Visitor.visitTree(JCTree.java:2270)
    at com.sun.tools.javac.tree.JCTree$Visitor.visitErroneous(JCTree.java:2267)
    at com.sun.tools.javac.tree.JCTree$JCErroneous.accept(JCTree.java:2085)
    at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:837)
    at com.sun.tools.javac.jvm.Gen.visitVarDef(Gen.java:1018)
    at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:727)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:684)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:719)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:705)
    at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:756)
    at com.sun.tools.javac.jvm.Gen.visitLetExpr(Gen.java:2209)
    at com.sun.tools.javac.tree.JCTree$LetExpr.accept(JCTree.java:2113)
    at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:837)
    at com.sun.tools.javac.jvm.Gen.visitVarDef(Gen.java:1018)
    at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:727)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:684)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:719)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:705)
    at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:756)
    at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:1031)
    at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:783)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:684)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:719)
    at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:912)
    at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:885)
    at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:671)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:684)
    at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2246)
    at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCodeUnlessError(LanguageCompiler.java:736)
    ... 21 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants