getDefinition method
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
TypedElement? getDefinition(String name) {
if (_definedSymbols[name] case final type?) {
return type;
} else if (enclosing case final enclosing?) {
return enclosing.getDefinition(name);
} else {
return null;
}
}