instantiatedType property Null safety

DartType instantiatedType
latefinal

Return this type, instantiated to bounds if it isn't already.

Implementation

@override
late final DartType instantiatedType = () {
  final bound = _bound;
  if (bound is InterfaceType &&
      !bound.typeArguments.every((t) => t is InterfaceType)) {
    var typeSystem = library.element.typeSystem;
    return typeSystem.instantiateInterfaceToBounds(
        element: bound.element2, nullabilitySuffix: _bound.nullabilitySuffix);
  } else {
    return _bound;
  }
}();