0 Replies
      Latest reply on Apr 9, 2017 3:51 AM by Joanna Carter
      Joanna Carter Level 1 Level 1 (0 points)

        I have been working on a new test project, focusing on generics, and got to the point where it would start indexing but would not complete, sending the CPU into overdrive


        After reading several posts about similar problems, I thought I would try commenting out all code and reinstating it one type at a time, deleting the project.xcworkspace from the project, as well as cleaning the DerivedData folder each time.


        Eventually, it boiled down to a typealias to a typealias to a closure


        public typealias EventClosure<senderT, argsT : EventArgs> = (senderT, argsT) -> ()


        public typealias PropertyChangedEventClosure<senderT> = EventClosure<senderT, PropertyChangedEventArgs>


        As soon as I changed the second typealias to :


        public typealias PropertyChangedEventClosure<senderT> = (senderT, PropertyChangedEventArgs) -> ()


        ... indexing happened and completed in a matter of a couple of seconds


        Now, this might not solve everyone's problems but I learnt (at least) two things :


        1. The Swift compiler is still very much a work in progress
        2. If your project gets stuck indexing, try to retrace your steps prior to that editing session and comment out all that code, reinstating it a bit at a time, until the indexing problem returns, then change the offending code


        The question for Apple to answer is : is the creation of a typealias to a typealias not meant to be allowed and, if it is, can you fix this indexing bug?