Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible types with if expression #2423

Open
jvasileff opened this issue Nov 8, 2015 · 0 comments
Open

incompatible types with if expression #2423

jvasileff opened this issue Nov 8, 2015 · 0 comments
Labels
Milestone

Comments

@jvasileff
Copy link
Member

The code below results in a backend error:

class Li<out Element>(shared Element* items) {}

shared void run() {
    Li<Li<String>> f = Li(Li("#1"));
    Li<String>? ns = f.items[0];
    value n = if (is Li<Anything> ns) then ns.items else (ns of Li<String>?); // ok
    value o = if (is Li<Anything> ns) then ns.items else ns; // error

    //Incompatible types
    //required: ceylon.language.Sequential<? extends ceylon.language.String>
    //found:    simple.Li<capture#1 of ? extends ceylon.language.String>
}

(Found when looking at #2422)

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

No branches or pull requests

2 participants