-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Suggest static members on protocol extensions with Self bound in unresolved member lookup #71760
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 |
f184baa
to
0b5e00c
Compare
Thanks for the suggestions @slavapestov. Could you take another look at the updated code? |
@swift-ci Please smoke test |
extension MyProto where Self: MyOtherProto { | ||
static var constrainedonMyInheritanceOfOtherProto: MyOtherProto { fatalError() } | ||
} | ||
extension MyProto where Self == MyOtherProto { |
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.
Shouldn't this be rejected? (Protocol doesn't self-conform)
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.
Yeah, but I still want to check that we don’t suggest it in code completion.
@swift-ci Please test Windows |
3 similar comments
@swift-ci Please test Windows |
@swift-ci Please test Windows |
@swift-ci Please test Windows |
let _: MyProto = .#^ON_MY_PROTO^# | ||
// ON_MY_PROTO: Begin completions, 1 items | ||
// ON_MY_PROTO-DAG: Decl[StaticVar]/CurrNominal/TypeRelation[Convertible]: constrainedOnMyStruct[#MyStruct#]; | ||
} |
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.
Could you add a test case for a case like
func testOpaqueMyProto() -> some MyProto {
return .#^HERE^#
}
which doesn't seems work either currently.
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, good idea. We handle it now.
…elf bound in unresolved member lookup rdar://122758029
0b5e00c
to
a176c07
Compare
@swift-ci Please smoke test |
rdar://122758029