• 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: Couldn't compile a Swift enum test
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Couldn't compile a Swift enum test


  • Subject: Re: Couldn't compile a Swift enum test
  • From: Daryle Walker <email@hidden>
  • Date: Tue, 28 Feb 2017 01:50:06 -0500


On Feb 27, 2017, at 7:17 PM, Saagar Jha <email@hidden> wrote:


Saagar Jha

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:

  1. You have a bunch of operators or overloaded functions in one line, or something that’s really complex, or
  2. 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 

 _______________________________________________
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

References: 
 >Couldn't compile a Swift enum test (From: Daryle Walker <email@hidden>)
 >Re: Couldn't compile a Swift enum test (From: Quincey Morris <email@hidden>)
 >Re: Couldn't compile a Swift enum test (From: Daryle Walker <email@hidden>)
 >Re: Couldn't compile a Swift enum test (From: Saagar Jha <email@hidden>)

  • Prev by Date: Re: Couldn't compile a Swift enum test
  • Next by Date: Re: Couldn't compile a Swift enum test
  • Previous by thread: Re: Couldn't compile a Swift enum test
  • Next by thread: Re: Couldn't compile a Swift enum test
  • Index(es):
    • Date
    • Thread