Uploaded image for project: 'Swift'
  1. Swift
  2. SR-2307

Swift 3: CharacterSet.isSuperset(of:) crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Foundation
    • Environment:

      Xcode 8 beta 4
      Apple Swift version 3.0 (swiftlang-800.0.41.2 clang-800.0.36)
      Target: x86_64-apple-macosx10.9

      Description

      Given the following sample code:

      import Foundation
      CharacterSet.letters.isSuperset(of: CharacterSet(charactersIn: "ab"))
      

      I get the following runtime crash:

      2016-08-09 12:01:16.993 swift[91581:18094762] Abstract class Foundation._SwiftNSCharacterSet does not implement method isSupersetOfSet:; it must be implemented in subclasses.
      2016-08-09 12:01:16.994 swift[91581:18094762] -[Foundation._SwiftNSCharacterSet isSupersetOfSet:]: unrecognized selector sent to instance 0x7fbe7ad14d10
      2016-08-09 12:01:17.058 swift[91581:18094762] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Foundation._SwiftNSCharacterSet isSupersetOfSet:]: unrecognized selector sent to instance 0x7fbe7ad14d10'
      

      I've tried Xcode 8 beta 4, but I believe it should be reproducible on Swift master as well because '_SwiftNSCharacterSet' defined in 'https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/CharacterSet.swift' doesn't implement this method.

        Attachments

          Activity

            People

            Assignee:
            phausler Philippe Hausler
            Reporter:
            hyp Alex Lorenz
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: