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

"Backend error: incompatible types" on method reference to Correspondence of union type #7465

Open
kingjon3377 opened this issue Jun 4, 2020 · 0 comments

Comments

@kingjon3377
Copy link

The following code fails to compile with a backend error, which the caret points at the start of Correspondence in the offending line:

interface SomeInterface {}
interface BaseType {
    shared formal Correspondence<SomeInterface|Integer,String> correspondence;
}
class Mwe(List<BaseType> list) {
    shared String? mwe(SomeInterface|Integer key) => min<String,Null>(list.map(
        // error: Ceylon backend error: incompatible types: Object cannot be converted to String
        shuffle(compose(Correspondence<SomeInterface|Integer,String>.get, BaseType.correspondence))(key)).coalesced);
}

I'm running the Ceylon compiler 1.3.3 on a Gentoo Linux system, where it's installed using my ebuild, which admittedly does its best to replace bundled libraries with system-installed ones that might be different versions ... but the code from which I distilled this MWE fails when running the binary distribution downloaded from ceylon-lang.org in a Travis CI build environment.

kingjon3377 added a commit to kingjon3377/strategicprimer-viewer that referenced this issue Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant