anchor.diff:  main() => new Class();
   """
             ]),
  -
  -      MessageKind.ABSTRACT_SETTER: const MessageTemplate(
  -          MessageKind.ABSTRACT_SETTER,
  -          "The setter '#{name}' has no implementation in "
  -          "class '#{class}'.",
  -          howToFix: "Try adding a body to '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -class Class {
  -  set setter(_);
  -}
  -main() => new Class();
  -"""
  -          ]),
  -
  -      MessageKind.INHERIT_GETTER_AND_METHOD: const MessageTemplate(
  -          MessageKind.INHERIT_GETTER_AND_METHOD,
  -          "The class '#{class}' can't inherit both getters and methods "
  -          "by the named '#{name}'.",
  -          howToFix: DONT_KNOW_HOW_TO_FIX,
  -          examples: const [
  -            """
  -class A {
  -  get member => null;
  -}
  -class B {
  -  member() {}
  -}
  -class Class implements A, B {
  -}
  -main() => new Class();
  -"""
  -          ]),
  -
  -      MessageKind.INHERITED_METHOD: const MessageTemplate(
  -          MessageKind.INHERITED_METHOD,
  -          "The inherited method '#{name}' is declared here in class "
  -          "'#{class}'."),
  -
  -      MessageKind.INHERITED_EXPLICIT_GETTER: const MessageTemplate(
  -          MessageKind.INHERITED_EXPLICIT_GETTER,
  -          "The inherited getter '#{name}' is declared here in class "
  -          "'#{class}'."),
  -
  -      MessageKind.INHERITED_IMPLICIT_GETTER: const MessageTemplate(
  -          MessageKind.INHERITED_IMPLICIT_GETTER,
  -          "The inherited getter '#{name}' is implicitly declared by this "
  -          "field in class '#{class}'."),
  -
  -      MessageKind.UNIMPLEMENTED_METHOD_ONE: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_METHOD_ONE,
  -          "'#{class}' doesn't implement '#{method}' "
  -          "declared in '#{declarer}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  m();
  -}
  -class C implements I {}
  -main() => new C();
  -""",
  -            """
  -abstract class I {
  -  m();
  -}
  -class C extends I {}
  -main() => new C();
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_METHOD: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_METHOD,
  -          "'#{class}' doesn't implement '#{method}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  m();
  -}
  -
  -abstract class J {
  -  m();
  -}
  -
  -class C implements I, J {}
  -
  -main() {
  - new C();
  -}
  -""",
  -            """
  -abstract class I {
  -  m();
  -}
  -
  -abstract class J {
  -  m();
  -}
  -
  -class C extends I implements J {}
  -
  -main() {
  - new C();
  -}
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_METHOD_CONT: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_METHOD_CONT,
  -          "The method '#{name}' is declared here in class '#{class}'."),
  -
  -      MessageKind.UNIMPLEMENTED_SETTER_ONE: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_SETTER_ONE,
  -          "'#{class}' doesn't implement the setter '#{name}' "
  -          "declared in '#{declarer}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  set m(_);
  -}
  -class C implements I {}
  -class D implements I {
  -  set m(_) {}
  -}
  -main() {
  - new D().m = 0;
  - new C();
  -}
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_SETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_SETTER,
  -          "'#{class}' doesn't implement the setter '#{name}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  set m(_);
  -}
  -abstract class J {
  -  set m(_);
  -}
  -class C implements I, J {}
  -main() => new C();
  -""",
  -            """
  -abstract class I {
  -  set m(_);
  -}
  -abstract class J {
  -  set m(_);
  -}
  -class C extends I implements J {}
  -main() => new C();
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
  -          "The setter '#{name}' is declared here in class '#{class}'."),
  -
  -      MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER,
  -          "The setter '#{name}' is implicitly declared by this field "
  -          "in class '#{class}'."),
  -
  -      MessageKind.UNIMPLEMENTED_GETTER_ONE: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_GETTER_ONE,
  -          "'#{class}' doesn't implement the getter '#{name}' "
  -          "declared in '#{declarer}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  get m;
  -}
  -class C implements I {}
  -main() => new C();
  -""",
  -            """
  -abstract class I {
  -  get m;
  -}
  -class C extends I {}
  -main() => new C();
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_GETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_GETTER,
  -          "'#{class}' doesn't implement the getter '#{name}'.",
  -          howToFix: "Try adding an implementation of '#{name}' or declaring "
  -              "'#{class}' to be 'abstract'.",
  -          examples: const [
  -            """
  -abstract class I {
  -  get m;
  -}
  -abstract class J {
  -  get m;
  -}
  -class C implements I, J {}
  -main() => new C();
  -""",
  -            """
  -abstract class I {
  -  get m;
  -}
  -abstract class J {
  -  get m;
  -}
  -class C extends I implements J {}
  -main() => new C();
  -"""
  -          ]),
  -
  -      MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
  -          "The getter '#{name}' is declared here in class '#{class}'."),
  -
  -      MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER: const MessageTemplate(
  -          MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
  -          "The getter '#{name}' is implicitly declared by this field "
  -          "in class '#{class}'."),
   
         MessageKind.INVALID_METADATA: const MessageTemplate(
             MessageKind.INVALID_METADATA,
  
positive.code:           " require a preamble file located in:\n"
            "  <sdk>/lib/_internal/js_runtime/lib/preambles."),
  
        MessageKind.INVALID_INLINE_FUNCTION_TYPE: const MessageTemplate(
          MessageKind.INVALID_INLINE_FUNCTION_TYPE,
          "Invalid inline function type.",
          howToFix: "Try changing the inline function type (as in 'int f()') to"
              " a prefixed function type using the `Function` keyword (as in "
              "'int Function() f').",
          examples: const [
            "typedef F = Function(int f(String x)); main() { F f; }"
          ],
        ),
  
        MessageKind.INVALID_SYNC_MODIFIER: const MessageTemplate(
            MessageKind.INVALID_SYNC_MODIFIER, "Invalid modifier 'sync'.",
            howToFix: "Try replacing 'sync' with 'sync*'.",
            examples: const ["main() sync {}"]),
  
        MessageKind.INVALID_AWAIT_FOR: const MessageTemplate(
            MessageKind.INVALID_AWAIT_FOR,
            "'await' is only supported on for-in loops.",
            howToFix: "Try rewriting the loop as a for-in loop or removing the "
                "'await' keyword.",
            examples: const [
              """
  main() async* {
    await for (int i = 0; i < 10; i++) {}
  }
  """
            ]),
  
        MessageKind.ASYNC_AWAIT_NOT_SUPPORTED: const MessageTemplate(
            MessageKind.ASYNC_AWAIT_NOT_SUPPORTED,
            "The async/sync* syntax is not supported on the current platform."),
  
        MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD: const MessageTemplate(
            MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
            "The modifier '#{modifier}' is not allowed on an abstract method.",
            options: const ['--enable-async'],
            howToFix: "Try removing the '#{modifier}' modifier or adding a "
                "body to the method.",
            examples: const [
              """
  abstract class A {
    method() async;
  }
  class B extends A {
    method() {}
  }
  main() {
    A a = new B();
    a.method();
  }
  """
            ]),
  
        MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR: const MessageTemplate(
            MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR,
            "The modifier '#{modifier}' is not allowed on constructors.",
            options: const ['--enable-async'],
            howToFix: "Try removing the '#{modifier}' modifier.",
            examples: const [
              """
  class A {
    A() async;
  }
  main() => new A();""",
              """
  class A {
    A();
    factory A.a() async* {}
  }
  main() => new A.a();"""
            ]),
  
        MessageKind.ASYNC_MODIFIER_ON_SETTER: const MessageTemplate(
            MessageKind.ASYNC_MODIFIER_ON_SETTER,
            "The modifier '#{modifier}' is not allowed on setters.",
            options: const ['--enable-async'],
            howToFix: "Try removing the '#{modifier}' modifier.",
            examples: const [
              """
  class A {
    set foo(v) async {}
  }
  main() => new A().foo = 0;"""
            ]),
  
        MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY: const MessageTemplate(
            MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY,
            "The modifier '#{modifier}' is not allowed on methods implemented "
            "using '=>'.",
            options: const ['--enable-async'],
            howToFix: "Try removing the '#{modifier}' modifier or implementing "
                "the method body using a block: '{ ... }'.",
            examples: const ["main() sync* => null;", "main() async* => null;"]),
  
        // TODO(johnniwinther): Check for 'async' as identifier.
        MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER: const MessageTemplate(
            MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER,
            "'#{keyword}' cannot be used as an identifier in a function body "
            "marked with '#{modifier}'.",
            options: const ['--enable-async'],
            howToFix: "Try removing the '#{modifier}' modifier or renaming the "
                "identifier.",
            examples: const [
              """
  main() async {
   var await;
  }"""
            ]),
  
        MessageKind.NATIVE_NOT_SUPPORTED: const MessageTemplate(
            MessageKind.NATIVE_NOT_SUPPORTED,
            "'native' modifier is not supported.",
            howToFix: "Try removing the 'native' implementation or analyzing the "
                "code with the --allow-native-extensions option.",
            examples: const [
              """
  main() native "Main";
  """
            ]),
  
        MessageKind.DART_EXT_NOT_SUPPORTED: const MessageTemplate(
            MessageKind.DART_EXT_NOT_SUPPORTED,
            "The 'dart-ext' scheme is not supported.",
            howToFix: "Try analyzing the code with the --allow-native-extensions "
                "option.",
            examples: const [
              """
  import 'dart-ext:main';
  
  main() {}
  """
            ]),
  
        MessageKind.LIBRARY_TAG_MUST_BE_FIRST: const MessageTemplate(
            MessageKind.LIBRARY_TAG_MUST_BE_FIRST,
            "The library declaration should come before other declarations.",
            howToFix: "Try moving the declaration to the top of the file.",
            examples: const [
              """
  import 'dart:core';
  library foo;
  main() {}
  """,
            ]),
  
        MessageKind.ONLY_ONE_LIBRARY_TAG: const MessageTemplate(
            MessageKind.ONLY_ONE_LIBRARY_TAG,
            "There can only be one library declaration.",
            howToFix: "Try removing all other library declarations.",
            examples: const [
              """
  library foo;
  library bar;
  main() {}
  """,
              """
  library foo;
  import 'dart:core';
  library bar;
  main() {}
  """,
            ]),
  
        MessageKind.IMPORT_BEFORE_PARTS: const MessageTemplate(
            MessageKind.IMPORT_BEFORE_PARTS,
            "Import declarations should come before parts.",
            howToFix: "Try moving this import further up in the file.",
            examples: const [
              const <String, String>{
                'main.dart': """
  library test.main;
  part 'part.dart';
  import 'dart:core';
  main() {}
  """,
                'part.dart': """
  part of test.main;
  """,
              }
            ]),
  
        MessageKind.EXPORT_BEFORE_PARTS: const MessageTemplate(
            MessageKind.EXPORT_BEFORE_PARTS,
            "Export declarations should come before parts.",
            howToFix: "Try moving this export further up in the file.",
            examples: const [
              const <String, String>{
                'main.dart': """
  library test.main;
  part 'part.dart';
  export 'dart:core';
  main() {}
  """,
                'part.dart': """
  part of test.main;
  """,
              }
            ]),
        MessageKind.INVALID_CONSTANT_CONDITIONAL_TYPE: const MessageTemplate(
            MessageKind.INVALID_CONSTANT_CONDITIONAL_TYPE,
            "`#{constant}` of type '#{type}' is not a valid constant condition. "
  
negative.code:   INVALID_CONSTANT_STRING_ADD_TYPE,
    INVALID_CONSTANT_STRING_LENGTH_TYPE,
    INVALID_CONSTANT_SHIFT,
    INVALID_FROM_ENVIRONMENT_NAME_TYPE,
    INVALID_INT_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
    INVALID_LOGICAL_AND_OPERAND_TYPE,
    INVALID_LOGICAL_OR_OPERAND_TYPE,
    INVALID_METADATA,
    INVALID_METADATA_GENERIC,
    INVALID_PACKAGE_CONFIG,
    INVALID_PACKAGE_URI,
    INVALID_STRING_FROM_ENVIRONMENT_DEFAULT_VALUE_TYPE,
    JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
    JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
    // TODO(johnniwinther): Why isn't this used?
    JS_INTEROP_INDEX_NOT_SUPPORTED,
    JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS,
    JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
    JS_PLACEHOLDER_CAPTURE,
    LIBRARY_NOT_FOUND,
    MIRRORS_LIBRARY_NOT_SUPPORT_WITH_CFE,
    MISSING_EXPRESSION_IN_THROW,
    MULTI_INHERITANCE,
    NO_SUCH_SUPER_MEMBER,
    NOT_A_COMPILE_TIME_CONSTANT,
    NOT_ASSIGNABLE,
    PLEASE_REPORT_THE_CRASH,
    PREAMBLE,
    RETHROW_OUTSIDE_CATCH,
    RETURN_IN_GENERATIVE_CONSTRUCTOR,
    RETURN_IN_GENERATOR,
    STRING_EXPECTED,
    UNDEFINED_GETTER,
    UNDEFINED_INSTANCE_GETTER_BUT_SETTER,
    UNDEFINED_METHOD,
    UNDEFINED_OPERATOR,
    UNDEFINED_SETTER,
    UNDEFINED_STATIC_GETTER_BUT_SETTER,
    UNDEFINED_STATIC_SETTER_BUT_GETTER,
    UNDEFINED_SUPER_SETTER,
    WRONG_ARGUMENT_FOR_JS,
    WRONG_ARGUMENT_FOR_JS_FIRST,
    WRONG_ARGUMENT_FOR_JS_SECOND,
    WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
  }
  
  /// A message template for an error, warning, hint or info message generated
  