• 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: Swift Array with Struct Members (Compiler Bug?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift Array with Struct Members (Compiler Bug?)


  • Subject: Re: Swift Array with Struct Members (Compiler Bug?)
  • From: Marco S Hyman <email@hidden>
  • Date: Thu, 11 Dec 2014 16:22:09 -0800

> Why did it compile if it's an incomplete type?  Shouldn't that be something that you catch at compile time in a type-safe language?

Don't know.  It failed on my machine.   I copied/pasted your code to a
playground and got a red exclamation point due to a fault. Then I looked
closer at the code and saw the [Array] which was wrong.

If you don't want to trust type inference you can fully specify the type.

Array<Array<Color>>(...)	or
[Array<Color>](...)		or
[[Color]](...)

which are all different ways of coding the same thing.  I find Array(...)
less to type :)
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Swift Array with Struct Members (Compiler Bug?)
      • From: Daniel Blakemore <email@hidden>
References: 
 >Swift Array with Struct Members (Compiler Bug?) (From: Daniel Blakemore <email@hidden>)
 >Re: Swift Array with Struct Members (Compiler Bug?) (From: Marco S Hyman <email@hidden>)
 >Re: Swift Array with Struct Members (Compiler Bug?) (From: Daniel Blakemore <email@hidden>)

  • Prev by Date: Re: Swift Array with Struct Members (Compiler Bug?)
  • Next by Date: Re: Swift Array with Struct Members (Compiler Bug?)
  • Previous by thread: Re: Swift Array with Struct Members (Compiler Bug?)
  • Next by thread: Re: Swift Array with Struct Members (Compiler Bug?)
  • Index(es):
    • Date
    • Thread