NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY constant

CompileTimeErrorCode const NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY

6.2.2 Optional Formals: It is a compile-time error if the default value of an optional parameter is not a compile-time constant.

12.1 Constants: A qualified reference to a static constant variable that is not qualified by a deferred prefix.

Implementation

NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode(
    'NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY',
    "Constant values from a deferred library can't be used as a default "
        "parameter value.",
    correction:
        "Try leaving the default as null and initializing the parameter "
        "inside the function body.")