Skip to content

Commit 4779ddc

Browse files
author
li3zhen1
committed
[CSDiagnostics] Update test case for callee side notes
1 parent 9a6d2b5 commit 4779ddc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4464,7 +4464,7 @@ ERROR(could_not_infer_pack_element,none,
44644464
"could not infer pack element #%0 from context", (unsigned))
44654465

44664466
NOTE(note_in_opening_pack_element,none,
4467-
"in infering pack element #%0 of '%1'", (unsigned,StringRef))
4467+
"in inferring pack element #%0 of '%1'", (unsigned,StringRef))
44684468

44694469

44704470
ERROR(type_of_expression_is_ambiguous,none,

test/Constraints/variadic_generic_functions.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,18 @@ do {
8383

8484
// apple/swift#69432 - Passing nil to a parameter pack fails to produce diagnostic for expression
8585
do {
86-
func foo<each T>(_ value: repeat each T) {}
86+
func foo<each T>(_ value: repeat each T) {} // expected-note {{in inferring pack element #1 of 'value'}}
87+
// expected-note@-1 {{in inferring pack element #1 of 'value'}}
88+
// expected-note@-2 {{in inferring pack element #2 of 'value'}}
8789

8890
foo(nil) // expected-error {{'nil' requires a contextual type}}
89-
foo(1, nil) // expected-error {{'nil' requires a contextual type}}
9091
foo(nil, 1) // expected-error {{'nil' requires a contextual type}}
92+
foo(2, nil) // expected-error {{'nil' requires a contextual type}}
9193

92-
func bar<each T, U, each W>(_ t: repeat each T, u: U, w: repeat each W) {}
94+
func bar<each T, U, each W>(_ t: repeat each T, u: U, w: repeat each W) {} // expected-note {{in inferring pack element #3 of 'w'}}
95+
// expected-note@-1 {{in inferring pack element #4 of 't'}}
9396

94-
bar(1, nil, "Hello", nil, u: 3, w: 4, 8, nil)
97+
bar(1, 2, 3, nil, "Hello", u: 3, w: 4, 8, nil) // expected-error {{'nil' requires a contextual type}}
9598
// expected-error@-1 {{'nil' requires a contextual type}}
96-
// expected-error@-2 {{'nil' requires a contextual type}}
97-
// expected-error@-3 {{'nil' requires a contextual type}}
9899

99100
}

0 commit comments

Comments
 (0)