isMap property
bool
get
isMap
Whether this literal represents a map literal.
This getter always returns false
if isSet returns true
.
However, this getter is not the inverse of isSet. It's possible for
both getters to return false
if
- the AST hasn't been resolved (because determining the kind of the literal is done during resolution),
- the literal is ambiguous (contains one or more spread elements and none of those elements can be used to determine the kind of the literal), or
- the literal is invalid because it contains both expressions (for sets) and map entries (for maps).
In both of the latter two cases there are compilation errors associated with the literal.
Implementation
bool get isMap;