On Feb 27, 2017, at 5:01 PM, Quincey Morris < email@hidden> wrote:
On Feb 27, 2017, at 03:50 , Daryle Walker < email@hidden> wrote:
- Have a Mac app with a framework - Writing unit tests for framework, going through the app - Have a Swift enum with 4 regular case and one with 2 associated values - Tried making unit tests, but get complaints from JIT compiling system about not finding equality - Looked up and found out that I have to define equality myself, since at least one enum case has associated values - Did equality in extension in same file as the enum - Sometimes it works, sometimes I still get the same errors - I thought I finally fixed it by defining the extension in the test file.... - But it sometimes complains about duplicate protocol definitions - Sometimes I get both sets of complaints, although they're contradictory - When my code compiles and tests anyway, does that mean the problem test file was skipped? Or is my file actually fine and it's Xcode's JIT compiling system (Source Kit?) that's fried? (Since Xcode 8, Source Kit goes wrong and/or takes exponential time.)
You’re kinda going to have to pick one question at a time. :)
What does “JIT compiling system” mean? What are the error messages? Do the error messages occur for different targets? You might have to look at the build transcripts to find out what build steps produced the errors, rather than relying on the placement of the errors in the source code file margins.
Only the last item is a question. (Actually two questions, but they’re linked.) The preceding items are how I got there. The list was written in anger while half-asleep.
I’m talking about the system that compiles the file as you type, which also colorizes the text and gives definitions on the side. After switching to Xcode 8, its speed has gone from decent to “I think a newbie programmer used an exponential-time loop” slow. One source of slow down it that the JIT insists on doing the definitions-on-the-side feature for every word you pass by with the cursor. Even if the cursor went by the word in less than a second. The JIT gets back-logged in looking up and displaying each definition, even though it would have been better to drop the lookup as soon as the cursor went by. It takes minutes for the back-log to clear (although it’s slowed down further by doing text-recoloring at the same time).
I think “SourceKit” is the name of Xcode analyze-the-code-in-real-time (i.e. JIT) system.
My project has two targets, the framework (which contains the new enum) and the app. But here I have a third system, the unit testing for the framework. The SourceKit freak-out is only in the unit test file for the new enum.
Right now, I took the enum and its unit-test file out of the project. I’m going to put them back in to see if that fixes things. (I also cleaned the project folder and restarted the computer.) I originally spelled the enum’s file-name wrong, and changed it in Xcode; that’s why I removed the file, to see if that resets anything.
— Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
|