visitNamedExpression method

  1. @override
Object? visitNamedExpression(
  1. SNamedExpression node
)
override

A named argument evaluates to its expression — the label is a name, not a value.

Without this the generalizing default returned null, so every site that dispatched a named argument rather than unwrapping it field-wise silently bound null. The redirecting-constructor initializer in callable.dart is exactly such a site: A() : this.named(a: 5) passed null, not 5.

Implementation

@override
Object? visitNamedExpression(SNamedExpression node) =>
    node.expression!.accept<Object?>(this);