hasTypeCoercion static method

bool hasTypeCoercion(
  1. Type sourceType,
  2. Type targetType
)

True when a coercion from sourceType to targetType is registered (registerTypeCoercion): a value of sourceType stands in for a targetType, so a type check of the target accepts it (ghissues28).

Implementation

static bool hasTypeCoercion(Type sourceType, Type targetType) =>
    _typeCoercionsByType.containsKey(_TypePair(sourceType, targetType));