ceylon
ceylon copied to clipboard
Unclear error message when type parameter satisfying union
void foo<T>(T t) given T satisfies String|Integer {}
.. gives the error for I of Integer:
Incorrect syntax: mismatched token Integer expecting & operator
This is on try.ceylon-lang.org. In IntelliJ IDEA I get a slightly more verbose message revealing the actual error:
multiple class upper bounds are not yet supported incorrect syntax mismatched token Integer expecting & operator
It gets hilarious if I feed the troll with a &:
void foo<T>(T t) given T satisfies String|&Integer {}
gives (in try.ceylon-lang.org):
Incorrect syntax: mismatched token & expecting & operator
Also, it wouid be handy if it actually wasn't an error :)