-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Improve accuracy of unresolved member completion #19584
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
[CodeCompletion] Improve accuracy of unresolved member completion #19584
Conversation
@swift-ci Please smoke test |
I'm not sure these are officially supported: // Implicit member expression via member type construction.
class Base {
class Derived : Base {}
}
let _: Base = .Derived()
// Implicit member expression via calling closure type static property.
struct Foo {
static var factory: () -> Foo = { fatalError() }
}
let _: Foo = .factory() I included them because the current compiler allows them. |
2e05863
to
028fd6c
Compare
@swift-ci Please smoke test |
@rintaro If they're allowed they're "supported". We don't have a formal spec :) At least the nested type case is something I've seen in real code before. Can you make sure they're tested somewhere in |
* Handle generic base types * Suggest '.some' and '.none' for optional types * Don't look through too many parameter lists for function types * Include members with convertible type result rdar://problem/44803439
// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/ExprSpecific: North[#SomeEnum1#]; | ||
// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/ExprSpecific: South[#SomeEnum1#]; | ||
// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/ExprSpecific: none[#Optional<Wrapped>#]; name=none | ||
// UNRESOLVED_3_OPTOPTOPT-DAG: Decl[EnumElement]/ExprSpecific: some({#Wrapped#})[#(Wrapped) -> Optional<Wrapped>#]; |
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.
Do we know why the generic Wrapped
isn't resolved here?
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, that is what I'm wondering too. I'll look into it in followups.
Some uncommon cases including: * Closure static properties * Nested types
028fd6c
to
07545b9
Compare
Added |
Follow up to #19567 (comment)
.some
and.none
for optional typesrdar://problem/44803439