On Feb 27, 2017, at 7:17 PM, Saagar Jha < email@hidden> wrote:
On Feb 27, 2017, at 14:42, Daryle Walker < email@hidden> wrote:
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.
Generally, if SourceKit is lagging or giving different results, this either means:
- You have a bunch of operators or overloaded functions in one line, or something that’s really complex, or
- You have a syntax error somewhere, and it’s making the compiler freak out. Try going line-by-line through your project and seeing which lines contribute to the issue, then try splitting it up or renaming things.
Of course, if this issue persists, I’m sure Apple would love to see a radar with a minimal test case.
I briefly had the same problem but I turned off inline-checking and I bullied through. The code coverage setting showed that the tests did run. I turned off that test so it hopefully won’t plague the rest of my project. Here’s my equality method:
extension InternetMessageLineCategory: Equatable {
public static func ==(lhs: InternetMessageLineCategory, rhs: InternetMessageLineCategory) -> Bool { switch (lhs, rhs) { case (.empty, .empty), (.headerContinuation, .headerContinuation), (.allBlanks, .allBlanks), (.other, .other): return true case let (.headerStart(n0, b0), .headerStart(n1, b1)): return n0 == n1 && b0 == b1 case (.empty, _), (.headerStart, _), (.headerContinuation, _), (.allBlanks, _), (.other, _): return false } }
}
Could the multiple enum checking conditions in the same case (and done twice) be the cause of the problem? (The structure here means no “default,” which means new cases will automatically error out.)
— Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
|