Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Backend error for illegal function shortcut specification #6426

Open
lucaswerkmeister opened this issue Aug 14, 2016 · 0 comments
Open

Backend error for illegal function shortcut specification #6426

lucaswerkmeister opened this issue Aug 14, 2016 · 0 comments

Comments

@lucaswerkmeister
Copy link
Contributor

lucaswerkmeister commented Aug 14, 2016

I was playing a bit with #6424 / 651058a and found this:

abstract class C() {
    shared formal String f(String s);
}
class D() extends C() {
    f => identity<String>;
}

Expected typechecker error:

source/tmp/run.ceylon:5: error: functions without parameters must be specified using =

    f => identity<String>;
      ^

Unexpected backend error:

source/tmp/run.ceylon:5: error: Ceylon backend error: incompatible types: <anonymous AbstractCallable<ceylon.language.String>> cannot be converted to java.lang.String

    f => identity<String>;
         ^

And even more unexpected javac error:

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.visitReturn(Gen.java:1809)
at com.redhat.ceylon.langtools.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1383)
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:800)

As always, generated code, @noanno’d.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants