Skip to content

Commit 7afe3fc

Browse files
committed
[NFC] s/Correct Type/Inferred Type
1 parent 6dcbec8 commit 7afe3fc

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3708,7 +3708,7 @@ ERROR(placeholder_type_not_allowed_in_return_type,none,
37083708
ERROR(placeholder_type_not_allowed_in_parameter,none,
37093709
"type placeholder may not appear in top-level parameter", ())
37103710
NOTE(replace_placeholder_with_inferred_type,none,
3711-
"replace the placeholder with the correct type %0", (Type))
3711+
"replace the placeholder with the inferred type %0", (Type))
37123712

37133713
WARNING(use_of_void_pointer,none,
37143714
"Unsafe%0Pointer<Void> has been replaced by Unsafe%0RawPointer", (StringRef))

test/Sema/placeholder_type.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let dict2: [Character: _] = ["h": 0]
88
let arr = [_](repeating: "hi", count: 3)
99

1010
func foo(_ arr: [_] = [0]) {} // expected-error {{type placeholder may not appear in top-level parameter}}
11-
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
11+
// expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
1212

1313
let foo = _.foo // expected-error {{could not infer type for placeholder}}
1414
let zero: _ = .zero // expected-error {{cannot infer contextual base in reference to member 'zero'}}
@@ -76,32 +76,32 @@ where T: ExpressibleByIntegerLiteral, U: ExpressibleByIntegerLiteral {
7676

7777
extension Bar {
7878
func frobnicate2() -> Bar<_, _> { // expected-error {{type placeholder may not appear in function return type}}
79-
// expected-note@-1 {{replace the placeholder with the correct type 'T'}}
80-
// expected-note@-2 {{replace the placeholder with the correct type 'U'}}
79+
// expected-note@-1 {{replace the placeholder with the inferred type 'T'}}
80+
// expected-note@-2 {{replace the placeholder with the inferred type 'U'}}
8181
return Bar(t: 42, u: 42)
8282
}
8383
func frobnicate3() -> Bar {
8484
return Bar<_, _>(t: 42, u: 42)
8585
}
8686
func frobnicate4() -> Bar<_, _> { // expected-error {{type placeholder may not appear in function return type}}
87-
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
88-
// expected-note@-2 {{replace the placeholder with the correct type 'Int'}}
87+
// expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
88+
// expected-note@-2 {{replace the placeholder with the inferred type 'Int'}}
8989
return Bar<_, _>(t: 42, u: 42)
9090
}
9191
func frobnicate5() -> Bar<_, U> { // expected-error {{type placeholder may not appear in function return type}}
92-
// expected-note@-1 {{replace the placeholder with the correct type 'T'}}
92+
// expected-note@-1 {{replace the placeholder with the inferred type 'T'}}
9393
return Bar(t: 42, u: 42)
9494
}
9595
func frobnicate6() -> Bar {
9696
return Bar<_, U>(t: 42, u: 42)
9797
}
9898
func frobnicate7() -> Bar<_, _> { // expected-error {{type placeholder may not appear in function return type}}
99-
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
100-
// expected-note@-2 {{replace the placeholder with the correct type 'U'}}
99+
// expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
100+
// expected-note@-2 {{replace the placeholder with the inferred type 'U'}}
101101
return Bar<_, U>(t: 42, u: 42)
102102
}
103103
func frobnicate8() -> Bar<_, U> { // expected-error {{type placeholder may not appear in function return type}}
104-
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
104+
// expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
105105
return Bar<_, _>(t: 42, u: 42)
106106
}
107107
}
@@ -235,9 +235,9 @@ func mismatchedDefault<T>(_ x: [_] = [String: T]()) {} // expected-error {{type
235235

236236
func mismatchedReturnTypes() -> _ { // expected-error {{type placeholder may not appear in function return type}}
237237
if true {
238-
return "" // expected-note@-2 {{replace the placeholder with the correct type 'String'}}
238+
return "" // expected-note@-2 {{replace the placeholder with the inferred type 'String'}}
239239
} else {
240-
return 0.5 // expected-note@-4 {{replace the placeholder with the correct type 'Double'}}
240+
return 0.5 // expected-note@-4 {{replace the placeholder with the inferred type 'Double'}}
241241
}
242242
}
243243

@@ -251,6 +251,6 @@ func opaque() -> some _ { // expected-error {{type placeholder not allowed here}
251251
enum EnumWithPlaceholders {
252252
case topLevelPlaceholder(x: _) // expected-error {{type placeholder may not appear in top-level parameter}}
253253
case placeholderWithDefault(x: _ = 5) // expected-error {{type placeholder may not appear in top-level parameter}}
254-
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
254+
// expected-note@-1 {{replace the placeholder with the inferred type 'Int'}}
255255
}
256256

0 commit comments

Comments
 (0)