You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the following code, the Swift compiler complains that func test() in the extension of Y needs to be public because it implements public protocol X, but also want it to be private because protocol Y is private. I think the correct thing to do is to allow public visibility in the extension when it implements a method from a public protocol.
publicprotocolX {
functest()
}
privateprotocolY: X {
}
extensionY {
publicfunctest() {}
}
publicclassZ: X, Y {
}
Below: the two error messages from a playground in Xcode 7.2.1 (7C1002) for the code above. Note that applying the first fix-it causes a new error accompanied by a new fix-it proposing a return to the version above (creating a loop). The second fix-it below generates invalid code with two public attributes before func.
Additional Detail from JIRA
md5: ce2ff1f56579c5c8afa230f4378fb4af
is duplicated by:
Issue Description:
With the following code, the Swift compiler complains that
func test()
in the extension ofY
needs to be public because it implements public protocolX
, but also want it to be private because protocolY
is private. I think the correct thing to do is to allow public visibility in the extension when it implements a method from a public protocol.Below: the two error messages from a playground in Xcode 7.2.1 (7C1002) for the code above. Note that applying the first fix-it causes a new error accompanied by a new fix-it proposing a return to the version above (creating a loop). The second fix-it below generates invalid code with two
public
attributes beforefunc
.The text was updated successfully, but these errors were encountered: