ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

invalid case type allowed #1402

Closed jvasileff closed 9 years ago

jvasileff commented 9 years ago

By example:

interface Enum<T> of Type1<T, T> {}
class Type1<T,U>() satisfies Enum<T> {}

shared void caseTypes() {
    Enum<String> x = Type1<String, Integer>();
    switch (x)
    case (is Type1<String,String>) {}
    // Exception in thread "main"
    // com.redhat.ceylon.compiler.java.language.EnumeratedTypeError:
    // Supposedly exhaustive switch was not exhaustive
}
gavinking commented 9 years ago

Fixed the bug but need to update the spec to document a new restriction.

gavinking commented 9 years ago

Spec updated. Closing.