Re: Does compile order matter for Swift files?
Re: Does compile order matter for Swift files?
- Subject: Re: Does compile order matter for Swift files?
- From: Quincey Morris <email@hidden>
- Date: Fri, 23 Jun 2017 10:46:24 -0700
On Jun 23, 2017, at 06:02 , Steve Christensen <email@hidden> wrote:
>
> Now, magically, the errors tab shows 6 errors across two files, neither of
> which had errors before and the errors don't refer to anything in those
> files. All of the other errors are no longer reported nor are they
> highlighted in the source files.
There are a couple of factors that might affect this.
— It looks to me like Xcode will stop trying to compile source files after a
certain number of errors (or number of files with errors, or …) is reached.
That can mean the errors you see depend on the order in which the files are
compiled.
— It’s possible, especially when you’re early in development, to have so many
missing/incorrect definitions that Source Kit gets confused and either crashes
or stops analyzing source. If nothing else, that may mean errors can’t be
tagged to specific source code lines.
— Based on something I read recently, Swift jumps between files during
compilation. In order to resolve mutual dependencies between definitions in
different files, it may partially compile a declaration, then go partially
compile a referenced declaration in another file. The pattern of referencing
will affect the order errors are detected in.
So the answer is probably that the order of the files affects the order in
which Swift *starts* to compile them, and things get complicated after that.
> Xcode 8.3.1
Why not at least 8.3.2? That was the stable release for a long time. (8.3.3 was
a minor update around the same time as WWDC.)
And if you’re just starting to put effort into Swift development, why not Xcode
9? It seems counterproductive to put effort into Swift 3 when Swift 4 is
already here (almost). There’s enough different in Swift 4 to make it
reasonable to skip Swift 3.
Xcode 9 is still rough around the edges (more so than usual, because it has
major reworking of a lot of things, especially a brand new source code editor),
and not everything that’s coming in Swift 4 is fully implemented yet, but it’s
a viable choice for a project you’re just starting out on.
_______________________________________________
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