ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

Abbreviation Boolean(String->String) not allowed according to spec #1349

Closed tombentley closed 9 years ago

tombentley commented 9 years ago

As I read the type abbreviation productions in the spec (§3.2.8.), a CallableType can have a TypeList between the parens which goes via VariadicType to UnionType, thus precluding the possibility of having a callable type with a EntryType argument. However, the typechecker accepts Boolean(String->String) just fine.

gavinking commented 9 years ago

No, you misread it. It's only if the last element is variadic that you can't have an EntryType there. that's because in the language generally, -> has a lower precedence than *. The non-variadic elements of a TypeList are (UnionType | EntryType) "="?.

tombentley commented 9 years ago

Ah, yes you're right. Sorry.