getType method

Type? getType(
  1. String name
)

Get a variable with the given name in the environment.

If the environment has not the expected name, it will rescursively look in the enclosing environment until it is found and return the value.

If this environment is a root environment and name is not found, null will be returned.

Implementation

Type? getType(String name) {
  if (_definedTypes[name] case final type?) {
    return type;
  } else if (enclosing case final enclosing?) {
    return enclosing.getType(name);
  } else {
    return null;
  }
}