musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

"Unused instance variable" text / false positive #100

Closed iccir closed 8 years ago

iccir commented 8 years ago

The following code gives a "Unused instance variable" warning. The instance variable is used, but it's never assigned and hence will always be nil.

Perhaps instead the warning should be "Instance variable _bar never assigned".

@implementation Foo {
    id _bar;
}

- (void) doSomethingWithBar
{
    [_bar doSomething];
}
@end
iccir commented 8 years ago

The above will now give a "Used but never assigned" warning.