EXTENDS_DISALLOWED_CLASS constant

CompileTimeErrorCode const EXTENDS_DISALLOWED_CLASS

12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.

12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.

12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.

12.3 Numbers: It is a compile-time error for any type other than the types int and double to attempt to extend or implement num.

12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.

12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.

Parameters: 0: the name of the type that cannot be extended

See IMPLEMENTS_DISALLOWED_CLASS and MIXIN_OF_DISALLOWED_CLASS.

TODO(scheglov) We might want to restore specific code with FrontEnd. https://github.com/dart-lang/sdk/issues/31821

Implementation

static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS =
    CompileTimeErrorCode(
        'EXTENDS_DISALLOWED_CLASS', "Classes can't extend '{0}'.",
        correction: "Try specifying a different superclass, or "
            "removing the extends clause.")