Closed lucaswerkmeister closed 10 years ago
Actually, I’d rather have it the other way around: That option types should not be optional and instead should have types like
Integer|None maxLinewidth
where
abstract class None of none|unlimited|...
so that people can write maxLinewidth = unlimited
.
and why should unlimited
, none
, etc. all be the same type? It would probably make even more sense to have
Integer|Unlimited maxLineWidth
// ---
maxLineWidth = unlimited
The only problem I see with that is that it leaves us with a lot of singleton classes. It’s a shame that we can’t write Integer|unlimited
... (but I guess that would make the grammar ambiguous: obj1 obj2 = obj1;
)
Similar to #14, CombinedOptions don’t work very well with optional types. Maybe we should have a special type
UnsetOption of unset {};
and use that for SparseFormattingOptions and CombinedOptions instead?