eclipse-archived/ceylon

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

Opened this issue · 0 comments

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.