Commit Graph

51 Commits

Author SHA1 Message Date
Doug Gregor
1e6b445cae Teach normal name lookup to find members of protocol extensions.
We do a silly little dance here of finding all of the members of
protocols and their extensions, then deleting the protocol members. In
the future, this is the place where we should handle the protocol
requirement -> witness mapping, including handling derived
conformances.

Basic protocol extensions seem to be working now:

  extension SequenceType {
    var myCount: Int {
      var result = 0
      for x in self {
        ++result
      }
      return result
    }
  }

  println(["a", "b", "c", "d"].myCount) // 4, duh

Swift SVN r26617
2015-03-27 00:10:21 +00:00