eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Source-gen: Better handling of optional types #14

Closed lucaswerkmeister closed 10 years ago

lucaswerkmeister commented 10 years ago

Our current handling of optional types for FormattingOptions is less than optimal for (at least) two reasons:

  1. It provides no error detection – if the user typed maxLineLength=8O, he probably meant 80, but we’ll parse null
  2. Corrolary: We can’t handle optional union types because we can’t know if the value was successfully parsed into the first type or not (see #13)

Suggested solution: Accept only the string "null" as null value (maxLineLength=null), handle the rest just like non-optional types.

lucaswerkmeister commented 10 years ago

Forgot that I have to do this in formattingFile_meta as well...

lucaswerkmeister commented 10 years ago

hm, formattingFile_meta currently fails anyways. Seems like a bug in the ceylon typechecker, I’ll have to investigate this tomorrow

lucaswerkmeister commented 10 years ago

Seems like a bug in the ceylon typechecker

actually, looks more like the compiler – reported as ceylon/ceylon-compiler#1465