convertTypeReference function

TypeReference convertTypeReference (DartType t)

Converts a DartType to a TypeReference.

Implementation

TypeReference convertTypeReference(DartType t) {
  return TypeReference((b) {
    b..symbol = t.name;

    if (t is InterfaceType) {
      b.types.addAll(t.typeArguments.map(convertTypeReference));
    }
  });
}