Skip to content

Commit ab71104

Browse files
Merge pull request #34954 from LucianoPAlmeida/nfc-typo
[NFC][Sema] Fix init diagnostic typo
2 parents 413352b + 5423da2 commit ab71104

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ ERROR(did_not_call_method,none,
10031003

10041004
ERROR(init_not_instance_member_use_assignment,none,
10051005
"'init' is a member of the type; use assignment "
1006-
"to initalize the value instead", ())
1006+
"to initialize the value instead", ())
10071007

10081008
ERROR(init_not_instance_member,none,
10091009
"'init' is a member of the type; use 'type(of: ...)' to initialize "

test/expr/postfix/dot/init_ref_delegation.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ func foo<T: C>(_ x: T, y: T.Type) where T: P {
272272
var ci4 = x.init(proto: "") // expected-error{{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{13-13=type(of: }} {{14-14=)}}
273273

274274
var z = x
275-
z.init(required: 0) // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{4-4= = }}
276-
z.init(x: 0) // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{4-4= = }}
277-
z.init() // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{4-4= = }}
278-
z.init(proto: "") // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{4-4= = }}
275+
z.init(required: 0) // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{4-4= = }}
276+
z.init(x: 0) // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{4-4= = }}
277+
z.init() // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{4-4= = }}
278+
z.init(proto: "") // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{4-4= = }}
279279

280280
var ci1a = z.init(required: 0) // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{14-14=type(of: }} {{15-15=)}}
281281
var ci2a = z.init(x: 0) // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{14-14=type(of: }} {{15-15=)}}
@@ -520,7 +520,7 @@ struct Y {
520520
let x2: X
521521

522522
init() {
523-
x.init() // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{6-6= = }}
523+
x.init() // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{6-6= = }}
524524
foo(x.init()) // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{9-9=type(of: }} {{10-10=)}}
525525
}
526526

@@ -537,7 +537,7 @@ struct MultipleMemberAccesses {
537537
init() {
538538
y = Y()
539539
y2 = Y()
540-
y.x.init() // expected-error {{'init' is a member of the type; use assignment to initalize the value instead}} {{8-8= = }}
540+
y.x.init() // expected-error {{'init' is a member of the type; use assignment to initialize the value instead}} {{8-8= = }}
541541
y2.x2.init() // expected-error {{'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type}} {{5-5=type(of: }} {{10-10=)}}
542542
}
543543
}

0 commit comments

Comments
 (0)