Skip to main content

contains_identifier_enum_pattern

Function contains_identifier_enum_pattern 

Source
pub fn contains_identifier_enum_pattern(program: &[SNode]) -> bool
Expand description

Return whether a program contains an enum-shaped match pattern whose receiver is a bare identifier (Status.Ready or Status.Error(value)).

Ordinary property access does not need enum metadata: the runtime module namespace supplies the same value through normal property lookup. The compiler only needs the imported-enum catalog when lowering these match patterns, where a dotted expression is otherwise indistinguishable from a value comparison. Keeping this predicate pattern-specific avoids forcing a full import-graph walk on modules that merely use record or namespace property access.