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

cannot narrow empty #2417

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

cannot narrow empty #2417

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

Comments

@jvasileff
Copy link
Member

This function (which is suspect, but valid) doesn't compile:

Iterable<Element, Absent> emptyify<Element, Absent>
        (Iterable<Element, Absent> stream)
        given Absent satisfies Null {
    if (stream.empty) {
        assert (is Iterable<Element, Absent> empty); // error
        return empty;
    }
    else {
        return stream;
    }
}
$ ceylon compile
source/simple/run.ceylon:5: error: cannot find symbol
        assert (is Iterable<Element, Absent> empty);
                ^
  symbol:   variable empty
  location: class emptyify_
ceylon compile: There was 1 error
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