// set the fields to remember the match
typeContainerContainingTarget = currentTypeContainer;
algebraicFunctionContainingTarget = currentAlgebraicFunction;
// find all the local definitions that are shadowed
TypeVariableScope scopeToCheck = scope;
while (scopeToCheck != null) {
for (final Binding<IdentifierInfo.TypeVariable> bindingInScope : scopeToCheck.getBindings()) {
if (newName.equals(bindingInScope.getIdentifierInfo().getTypeVarName())) {
shadowedTypeVars.put(bindingInScope.getIdentifierInfo(), bindingInScope);
}
}
scopeToCheck = scopeToCheck.getParent();
}
}
typeVarsInCurrentTypeContainer.add(binding.getIdentifierInfo().getTypeVarName());