Skip to content

[CodeComplete] Don't emit 'override' in protocol extension #7140

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

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 30, 2017

  • Don't emit any inherited decls in protocol declarations.
  • Don't emit override keyword in protocol extensions.

Previously:

protocol BaseP {
  init(base: Int)
  func baseFunc()
  var baseVal: Int { get }
}

protocol TestP : BaseP {
   #^PROTO^#
}
extension TestP {
  #^PROTO_EXT^#
}

For both #^PROTO^# and #^PROTO_EXT^#:

Begin completions, 3 items
Decl[Constructor]/Super:            override init(base: Int) {|}; name=init(base: Int)
Decl[InstanceMethod]/Super:         override func baseFunc() {|}; name=baseFunc()
Decl[InstanceVar]/Super:            override var baseVal: Int; name=baseVal: Int
End completions

We don't want any for #^PROTO^#.
override is invalid for #^PROTO_EXT^#.

CC/ @benlangmuir

Also, don't emit any inherited decls in protocol declaration.
@rintaro
Copy link
Member Author

rintaro commented Jan 30, 2017

@swift-ci Please smoke test

@benlangmuir
Copy link
Contributor

LGTM

@slavapestov slavapestov merged commit 36cd7b5 into swiftlang:master Jan 30, 2017
@rintaro rintaro deleted the codecomplete-override-protocol branch January 31, 2017 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants