-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Sema] Emit only "public" access modifier in fix-it for missing witness #4585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please smoke test |
Code LGTM. @benlangmuir? Can you add a test for a non-type requirement that needs |
LGTM too |
@jrose-apple @benlangmuir Thanks! @jrose-apple What "non-type requirement" mean? non-class-type? |
Non-associated-type. Right now the only test that inserts "public" is the associated type one, right? Or are there some that just didn't show up in the diff because they didn't change? |
} | ||
|
||
public protocol ProtocolWithPublicAccess3 { | ||
func foo() // expected-note{{protocol requires function 'foo()' with type '() -> ()'; do you want to add a stub?}} {{78-78=\n public func foo() {\n <#code#>\n \}\n}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrose-apple Here's non-associatedtype
test that emits public
. Do we need init()
, var
, or subscript
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm sorry, somehow I missed this one. All good, please feel free to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Sorry, I'm not authorized to merge. Could you?
Or @shahmishal, Could you authorize me to merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instructions for getting commit access are at https://swift.org/contributing/#contributing-code "Commit Access" 😃
@benlangmuir Thanks! Actually I've been granted commit access on Jun. 1. |
Yes, I believe that's true. I'm unable to merge my code directly. |
Same here, at least in this repo. I can merge into swift-evolution. |
@shahmishal tells me this should be fixed now. After the required tests have passed, you should be able to hit the merge button if you have commit access. Let us know if it doesn't work! |
Confirmed on other PRs. Thank you! |
Yes, the merge button is green now. Thanks 😄 |
Previously, fix-it tries to insert
internal func foo() { <#code#> }
.With this PR, fix-it emits
public
access modifier only if the protocol and the class arepublic
(oropen
).