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

Shorthand syntax doesn't work in some instances.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      Xcode 11.4.1 (11E503a)

      Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)

      Target: x86_64-apple-darwin19.4.0

      Description

      Attempting to compile the code:

      "test ".trimmingCharacters(in: .alphanumerics.inverted)

      does not compile. The fatal error states "Cannot infer contextual base in reference to member 'alphanumerics'"

      Instead I am required to enter:

      "test ".trimmingCharacters(in: CharacterSet.alphanumerics.inverted)

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            davidde_94 David Evans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: