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

Wrong fixit when the type doesn't conform to a public protocol

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      Xcode 9.3, Swift 4.1

      Description

      This is my code without the protocol conformance 

      public struct Numbers: OptionSet

      {

          public let rawValue: Int

          

          static let one = Numbers(rawValue: 1)

          static let two = Numbers(rawValue: 2)

      }

       

      The error message - " Initializer 'init(rawValue' must be declared public because it matches a requirement in public protocol 'OptionSet' " is correct, but the fixit inserts  'public'  after 'struct' like this - 

       

      public struct public Numbers: OptionSet

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sriharims Srihari M S
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: