code: public static void fixUpLocalVariables(List<? extends Variable> localVariables, VariableScope scope, boolean isClosureScope) {
      for (Variable localVar : localVariables) {
        Variable scopeVar = scope.getReferencedClassVariable(localVar.getName());
        if (scopeVar instanceof DynamicVariable) {
          scope.removeReferencedClassVariable(localVar.getName());
          scope.putReferencedLocalVariable(localVar);
          if (isClosureScope)
            localVar.setClosureSharedVariable(true);
        }
      }
    }
docs: Fixes up scope references to variables that used to be free or class variables,
  and have been changed to local variables.