ceylon icon indicating copy to clipboard operation
ceylon copied to clipboard

JS-related switch pattern error

Open arseniiv opened this issue 7 years ago • 1 comments

Running the code

switch ([1, 2, 3])
case ([Object head, Object* args]) {
    printAll { head, args };
}
else { print("error"); }

for JS backend (see https://try.ceylon-lang.org/?gist=c7c1a51ea100cc6a16c8de3aa34971cb) prints “error”.

Alternative example:

switch ([1, 2, 3] of [Object,Object*])
case ([Object head, Object* args]) {
    printAll { head, args };
}

gives runtime error ceylon.language::Exception "Supposedly exhaustive switch was not exhaustive".

arseniiv avatar May 04 '18 15:05 arseniiv

Confirmed. Thanks for reporting.

gavinking avatar Sep 14 '18 23:09 gavinking