retrieveGenericType method

TypeDefinition retrieveGenericType()

Retrieves the generic from this type. Throws a FormatException if no generic is found.

Implementation

TypeDefinition retrieveGenericType() {
  var genericType = generics.firstOrNull;
  if (genericType == null) {
    throw FormatException('$this does not have a generic type to retrieve.');
  }

  return genericType;
}