mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Previously, were were suggesting to add `()` after eg. `x.` if `x` has a function type, resulting in `x.()`, which is incorrect. We need to remove the `.` in the completion suggestion. rdar://121155241
17 lines
548 B
Swift
17 lines
548 B
Swift
// RUN: %batch-code-completion
|
|
|
|
struct Foo {
|
|
func bar(argLabel: Int) -> Int { 1 }
|
|
}
|
|
let x = Foo().bar
|
|
x.#^AFTER_DOT^#
|
|
// AFTER_DOT: Pattern/CurrModule/Flair[ArgLabels]/Erase[1]: ({#Int#})[#Int#]; name=()
|
|
|
|
x. #^AFTER_DOT_AND_SPACE^#
|
|
// AFTER_DOT_AND_SPACE: Pattern/CurrModule/Flair[ArgLabels]/Erase[2]: ({#Int#})[#Int#]; name=()
|
|
|
|
x.#^AFTER_DOT_FOLLOWING_DOT?check=AFTER_DOT^#.
|
|
|
|
Foo().bar.#^UNRESOLVED_MEMBER_REF^#
|
|
// UNRESOLVED_MEMBER_REF: Decl[InstanceMethod]/CurrNominal/Flair[ArgLabels]/Erase[1]: ({#argLabel: Int#})[#Int#]; name=(argLabel:)
|