WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE constant

CompileTimeErrorCode const WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE

Let C be a generic class that declares a formal type parameter X, and assume that T is a direct superinterface of C.

It is a compile-time error if X is explicitly defined as a covariant or 'in' type parameter and X occurs in a non-covariant position in T. It is a compile-time error if X is explicitly defined as a contravariant or 'out' type parameter and X occurs in a non-contravariant position in T.

Parameters: 0: the name of the type parameter 1: the variance modifier defined for {0} 2: the variance position of the type parameter {0} in the superinterface {3} 3: the name of the superinterface

Implementation

WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE =
CompileTimeErrorCode(
    'WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE',
    "'{0}' is an '{1}' type parameter and can't be used in an '{2}' position in '{3}'.",
    correction: "Try using 'in' type parameters in 'in' positions and 'out' "
  "type parameters in 'out' positions in the superinterface.",
  )