• 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 15:59:14 -0800

On Dec 11, 2014, at 3:24 PM, Daniel Blakemore <email@hidden> wrote:
>
> If I do this, however, it breaks:
> var arr2 = [Array](count:6, repeatedValue:[Color](count:8, repeatedValue:
> Color()))

[Array] is syntactic sugar for Array<Array>.  It is not a complete type.
It is an array of arrays of ????

Let the type inference work for you.  Try it this way and see if it generates
what you desire.

var arr2 = Array(count:6, repeatedValue:Array(count:8, repeatedValue:Color()))

Marc


_______________________________________________

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>)

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