| Consider the following snippet (gcc v 4.0.1):
@interface Foo : NSObject - (void) doSomething: (float) x; @end @implementation Foo - (void) doSomething: (float) x { } @end
@interface Bar : Foo @end @implementation Bar - (void) doSomething: (int) x { } @end
If Foo's "doSomething" were implemented with (int) x, there would be a warning:
test.mm:7: warning: conflicting types for ‘-(void)doSomething:(float)x’ test.mm:4: warning: previous declaration of ‘-(void)doSomething:(int)x’
However, no such warning exists for Foo's subclass Bar's conflicting implementation - as a result:
[[Bar alloc] doSomething: 0.5];
will result in (at best) garbage results.
Shouldn't this at least merit a warning?
rdar://5370783
quadrium | flame : flame fractals & strange attractors : build, mutate, evolve, animate
|