Open ThunderFrame opened 6 years ago
That's by design actually; the inspection explicitly only looks at procedure-scope variables. Arguably the issue is the same at module-scope, but it was thought that a module-level variable declared As New
pretty much implied that it means to live as long as the class it's declared in.
I guess it wouldn't hurt to enhance the inspection to also look at module scope... The meta/descriptions need to be updated too.
Maybe split it into 2 inspections? The descriptions could vary by module/procedure scope, with differing levels of severity and caution/advice to the user? Likewise, the inspections could then be disabled per scope.
The following code generates Object variable reference is auto-instantiated inspections for
fizz
andbuzz
but not forfoo
andbar