ceylon/ceylon-compiler — Issue #296: CCE in backend
Author: gavinking
Created: 2011-12-19 06:43:52+00:00
State: open
Labels: BUG

The following line:

print { String line { return "hello"; } };

Results in a correct warning from the typechecker about the unimplemented feature. But the backend ignores the warning, and stacktraces:

java.lang.ClassCastException: com.redhat.ceylon.compiler.typechecker.tree.Tree$AttributeArgument cannot be cast to com.redhat.ceylon.compiler.typechecker.tree.Tree$SpecifiedArgument
at com.redhat.ceylon.compiler.codegen.ExpressionTransformer.transformNamedInvocation(ExpressionTransformer.java:901)
at com.redhat.ceylon.compiler.codegen.ExpressionTransformer.transform(ExpressionTransformer.java:866)
at com.redhat.ceylon.compiler.codegen.CeylonVisitor.visit(CeylonVisitor.java:273)
at com.redhat.ceylon.compiler.typechecker.tree.Tree$InvocationExpression.visit(Tree.java:4586)
at com.redhat.ceylon.compiler.typechecker.tree.Walker.walkExpression(Walker.java:952)
at com.redhat.ceylon.compiler.typechecker.tree.Tree$Expression.visitChildren(Tree.java:4511)
at com.redhat.ceylon.compiler.codegen.ExpressionTransformer.transformExpression(ExpressionTransformer.java:131)
at com.redhat.ceylon.compiler.codegen.ExpressionTransformer.transform(ExpressionTransformer.java:92)
at com.redhat.ceylon.compiler.codegen.CeylonVisitor.visit(CeylonVisitor.java:265)
at com.redhat.ceylon.compiler.typechecker.tree.Tree$ExpressionStatement.visit(Tree.java:2061)
at com.redhat.ceylon.compiler.codegen.StatementTransformer.transformStmts(StatementTransformer.java:88)
at com.redhat.ceylon.compiler.codegen.StatementTransformer.transform(StatementTransformer.java:80)
at com.redhat.ceylon.compiler.codegen.ClassTransformer.transform(ClassTransformer.java:326)
at com.redhat.ceylon.compiler.codegen.ClassTransformer.transformWrappedMethod(ClassTransformer.java:276)
at com.redhat.ceylon.compiler.codegen.CeylonVisitor.visit(CeylonVisitor.java:156)
at com.redhat.ceylon.compiler.typechecker.tree.Tree$MethodDefinition.visit(Tree.java:979)
at com.redhat.ceylon.compiler.typechecker.tree.Walker.walkCompilationUnit(Walker.java:13)
at com.redhat.ceylon.compiler.typechecker.tree.Tree$CompilationUnit.visitChildren(Tree.java:30)
at com.redhat.ceylon.compiler.codegen.CeylonTransformer.transformAfterTypeChecking(CeylonTransformer.java:116)
at com.redhat.ceylon.compiler.loader.CeylonEnter.completeCeylonTrees(CeylonEnter.java:176)
at com.redhat.ceylon.compiler.loader.CeylonEnter.main(CeylonEnter.java:117)
at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:905)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:807)
at com.redhat.ceylon.compiler.launcher.Main.compile(Main.java:425)