Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was 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

@kingjon3377

Description

@kingjon3377

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions