Re: Why this error in Xcode beta 4?
Re: Why this error in Xcode beta 4?
- Subject: Re: Why this error in Xcode beta 4?
- From: Quincey Morris <email@hidden>
- Date: Wed, 23 Jul 2014 23:30:04 -0700
On Jul 23, 2014, at 21:21 , Gerriet M. Denkmann <email@hidden> wrote:
Should the compiler not know that MySubclassOfNSDocument is indeed what the name implies?
It does know that, but it doesn’t help. The compiler knows that the first parameter to the block will be a NSDocument (remember that it has no idea where the object being passed in this parameter comes from), so the object might *not* be a MySubclassOfNSDocument.
Note that we often mis-declare *override method* parameters like this, because the compiler lets us (with the default warning flags), but it isn’t safe from the compiler’s point of view. We either need to reason externally that the class will be what we say, or test the class at run-time.
I guess this leniency was never provided by the compiler for block parameters. (And it won’t work for override methods in Swift, I’d assume.)
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden