musictheory / NilScript

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

Typechecker: Type 'id' should accept a class #96

Closed iccir closed 8 years ago

iccir commented 8 years ago

The follow produces a bogus type checker warning:

@implementation NotificationCenter
…
- (void) postNotificationName:(String)name object:(id)object {
…
}
@end

@implementation NotificationCenter
+ (void) aClassMethod {
    [[NotificationCenter defaultCenter] postNotificationName:"Foo" object:self]; // Error
}
@end

As in Objective-C, id should be able to take a Class