• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why this error in Xcode beta 4?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Why this error in Xcode beta 4? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Why this error in Xcode beta 4?
  • Next by Date: Set watchpoint on instance variable
  • Previous by thread: Why this error in Xcode beta 4?
  • Next by thread: Set watchpoint on instance variable
  • Index(es):
    • Date
    • Thread