+ # Shift and check the last scope
+ fun shift_scope
+ do
+ assert not scopes.is_empty
+ var scope = scopes.shift
+ for v in scope.variables.values do
+ if v.warn_unread then
+ toolcontext.advice(v.location, "unread-variable", "Warning: local variable {v.name} is never read.")
+ end
+ end
+ end
+
+ # Register a local variable.