instantiatedType property

DartType instantiatedType
override

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

Implementation

@override
DartType get instantiatedType {
  if (_instantiatedType == null) {
    if (_bound is InterfaceType &&
        !(_bound as InterfaceType)
            .typeArguments
            .every((t) => t is InterfaceType)) {
      var typeSystem = library.element.typeSystem;
      _instantiatedType = typeSystem.instantiateToBounds2(
          classElement: _bound.element as ClassElement,
          nullabilitySuffix: _bound.nullabilitySuffix);
    } else {
      _instantiatedType = _bound;
    }
  }
  return _instantiatedType;
}