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
Another problem is that the subsequent stubs that get added use the newly created type <#type#>. IMO, it should instead use the typealias NSViewType because that helps prevent the signature from becoming invalidated in case you change what the typealias NSViewType is referring to.
It might make sense to de-prioritize type aliases — those can often get picked up from other requirements, so they end up not being necessary. For example, when you conform to the Sequence protocol, the `Iterator` type nearly always gets inferred from the `makeIterator()` requirement's return type.
Additional Detail from JIRA
md5: 1665b5142f4d5da0d721b8952c21bc92
Issue Description:
Tested with Swift 5.3.2 (Xcode 12.3, build 12C33)
Consider the following code:
Xcode suggests adding protocol stubs. If you use the fix-it, then it will add in
typealias NSViewType = <#type#>
.If you don't write the type: Xcode will suggest adding protocol stubs and if you click Fix, it will add another
typealias NSViewType = <#type#>
.If you do write the type, it will still suggest adding protocol stubs. If you click Fix, now it adds stubs for
func makeNSView
andfunc updateNSView.
It would be nice if:
We didn't add a duplicate stub in case there's an error (easy mistake to make if you're going too fast).
Add all the stubs at once, instead of going back-and-forth.
The text was updated successfully, but these errors were encountered: