isSet property

bool get isSet

Whether this literal represents a set literal.

This getter always returns false if isMap returns true.

However, this getter is not the inverse of isMap. 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 isSet;