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

SourceKit suggests autocomplete for unavailable constrained methods

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: CodeCompletion
    • Labels:
      None

      Description

      SourceKit is providing autocomplete suggestions for symbols that are constrained, but not allowed on a particular instance. For example:
       

      struct Item<T> {}
      enum A {}
      enum B {}
      extension Item where T == A {
          var a: String { return "a" }
      }
      extension Item where T == B {
          var b: String { return "b" }
      }
      

      If you create an instance of Item<A> and then use autocomplete to get the list of available symbols, it includes b when it shouldn't.

      (As reported in: https://forums.swift.org/t/constrained-extensions-and-auto-completion/17115)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rintaro Rintaro Ishizaki
                Reporter:
                nnnnnnnn Nate Cook
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: