ceylon icon indicating copy to clipboard operation
ceylon copied to clipboard

incorrectly-typed code crashes the Java backend

Open dlkw opened this issue 8 years ago • 0 comments

I know, interface D below should satisfy C&B for the last line to compile without error, but this causes a backend error on JVM.

interface I{}
interface A{}
interface B satisfies A{}

interface C satisfies I&A{}
interface D satisfies I&B{}

class X() satisfies D{}
C c = X();
Description	Resource	Path	Location	Type
The Ceylon Java backend compilation failed
  with 1 malformed Javac tree cases
  with a throwable : java.lang.RuntimeException: Error generating bytecode for /home/dlatt/eclipse-workspace/gamov/source/de/dlkw/util/io/IOHelper.ceylon
	at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCodeUnlessError(LanguageCompiler.java:839)
	at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCode(LanguageCompiler.java:776)
	at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1575)
	at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.generate(LanguageCompiler.java:953)
	at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1539)
	at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:904)
	at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:862)
	at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.compile(LanguageCompiler.java:270)
	at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:660)
	at com.redhat.ceylon.langtools.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:132)
	at com.redhat.ceylon.langtools.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:141)
	at com.redhat.ceylon.compiler.java.tools.CeyloncTaskImpl.call(CeyloncTaskImpl.java:59)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.compile(CeylonBuilder.java:2663)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.generateBinaries(CeylonBuilder.java:2392)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.access$100(CeylonBuilder.java:210)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$4.call(CeylonBuilder.java:1075)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$4.call(CeylonBuilder.java:1072)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.doWithCeylonModelCaching(CeylonBuilder.java:260)
	at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.build(CeylonBuilder.java:1072)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.AssertionError: typecode ERROR
	at com.redhat.ceylon.langtools.tools.javac.jvm.Code.typecode(Code.java:248)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Items.makeStackItem(Items.java:110)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitNewClass(Gen.java:1935)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1515)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genExpr(Gen.java:949)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitAssign(Gen.java:1988)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1685)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genExpr(Gen.java:949)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitExec(Gen.java:1779)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1295)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:774)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:760)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStats(Gen.java:811)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitBlock(Gen.java:1159)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:908)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:774)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:760)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genTry(Gen.java:1492)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitTry(Gen.java:1480)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1172)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:774)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:760)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStats(Gen.java:811)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitBlock(Gen.java:1159)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:908)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:774)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:760)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStats(Gen.java:811)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitBlock(Gen.java:1159)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:908)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genStat(Gen.java:774)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genMethod(Gen.java:1033)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.visitMethodDef(Gen.java:996)
	at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:777)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genDef(Gen.java:739)
	at com.redhat.ceylon.langtools.tools.javac.jvm.Gen.genClass(Gen.java:2461)
	at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.genCodeUnlessError(LanguageCompiler.java:810)
	... 30 more
	gamov		line 0	Ceylon Backend Error

dlkw avatar Jan 14 '18 10:01 dlkw