checkValidity static method

void checkValidity(
  1. MethodInvocation node,
  2. List<Expression> arguments,
  3. String? outerName,
  4. List<FormalParameter> outerArgs, {
  5. bool nameAndArgsGenerated = false,
  6. bool examplesRequired = false,
})
override

Verify that this looks like a correct Intl.message invocation.

Implementation

static void checkValidity(
  MethodInvocation node,
  List<Expression> arguments,
  String? outerName,
  List<FormalParameter> outerArgs, {
  bool nameAndArgsGenerated = false,
  bool examplesRequired = false,
}) {
  if (arguments.first is! StringLiteral) {
    throw MessageExtractionException(
      'Intl.message messages must be string literals',
    );
  }

  Message.checkValidity(
    node,
    arguments,
    outerName,
    outerArgs,
    nameAndArgsGenerated: nameAndArgsGenerated,
    examplesRequired: examplesRequired,
  );
}