Files
swift-mirror/test/IDE/complete_call_pattern_after_dot.swift
Alex Hoppen 88275d48e6 [CodeComplete] Delete . in completion suggestions of call pattern
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
2024-01-22 12:29:05 -08:00

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:)