Re: Swift Array with Struct Members (Compiler Bug?)
Re: Swift Array with Struct Members (Compiler Bug?)
- Subject: Re: Swift Array with Struct Members (Compiler Bug?)
- From: Daniel Blakemore <email@hidden>
- Date: Thu, 11 Dec 2014 17:28:29 -0700
It's not that I don't trust that it works, I don't trust that what I try
will work. It's like in those long hours of debugging some
non-deterministic, impossible-to-find error where you start to doubt things
like the order of operations so you add more parens "just to be sure".
And I indicated it failed in a playground. It did build successfully in a
command line project, though.
--
Daniel Blakemore
Pixio Software
On Thu, Dec 11, 2014 at 5:22 PM, Marco S Hyman <email@hidden> wrote:
>
> > 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