-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Labels
Description
We're working on two new language features:
These two features can be combined:
var list = <double>[? .infinity];It's sort of like we're adding two new prefix operators (though the . isn't really a prefix operator). However, there is already a ?. operator and the lexical grammar tokenizes that as a single unit.
This means that if the formatter encounters a shorthand .foo expression inside a null-aware element ? expression, it must preserve a space between the ? and .. We have a similar edge case in the formatter around preserving a space between chained unary - operators like - -a so that it doesn't accidentally turn them into a prefix decrement.