mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Improve diagnostics message for swift users.
Use `initializer` instead of `constructor` because it is more official word to express its meaning.
This commit is contained in:
@@ -7,11 +7,11 @@ func test_subscript_accepts_type_name_argument() {
|
||||
}
|
||||
|
||||
func test(a: A, optA: A?) {
|
||||
let _ = a[A] // expected-error {{expected member name or constructor call after type name}}
|
||||
let _ = a[A] // expected-error {{expected member name or initializer call after type name}}
|
||||
// expected-note@-1 {{add arguments after the type to construct a value of the type}} {{16-16=()}}
|
||||
// expected-note@-2 {{use '.self' to reference the type object}} {{16-16=.self}}
|
||||
|
||||
let _ = optA?[A] // expected-error {{expected member name or constructor call after type name}}
|
||||
let _ = optA?[A] // expected-error {{expected member name or initializer call after type name}}
|
||||
// expected-note@-1 {{add arguments after the type to construct a value of the type}} {{20-20=()}}
|
||||
// expected-note@-2 {{use '.self' to reference the type object}} {{20-20=.self}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user