Skip to content

Commit 367cc7d

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents d84eee2 + 968783f commit 367cc7d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ ERROR(cannot_apply_lvalue_binop_to_rvalue,none,
213213
"left side of mutating operator has immutable type %0", (Type))
214214

215215
ERROR(cannot_subscript_with_index,none,
216-
"cannot subscript a value of type %0 with an index of type %1",
216+
"cannot subscript a value of type %0 with an argument of type %1",
217217
(Type, Type))
218218

219219
ERROR(cannot_subscript_base,none,

test/Constraints/diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func r21459429(_ a : Int) {
215215
}
216216

217217

218-
// <rdar://problem/21362748> [WWDC Lab] QoI: cannot subscript a value of type '[Int]?' with an index of type 'Int'
218+
// <rdar://problem/21362748> [WWDC Lab] QoI: cannot subscript a value of type '[Int]?' with an argument of type 'Int'
219219
struct StructWithOptionalArray {
220220
var array: [Int]?
221221
}

test/Constraints/subscript.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class C_r25601561 {
110110
// rdar://problem/31977679 - Misleading diagnostics when using subscript with incorrect argument
111111

112112
func r31977679_1(_ properties: [String: String]) -> Any? {
113-
return properties[0] // expected-error {{cannot subscript a value of type '[String : String]' with an index of type 'Int'}}
113+
return properties[0] // expected-error {{cannot subscript a value of type '[String : String]' with an argument of type 'Int'}}
114114
}
115115

116116
func r31977679_2(_ properties: [String: String]) -> Any? {

test/decl/subscript/subscripting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ struct SubscriptTest2 {
318318
}
319319

320320
func testSubscript1(_ s2 : SubscriptTest2) {
321-
_ = s2["foo"] // expected-error {{cannot subscript a value of type 'SubscriptTest2' with an index of type 'String'}}
321+
_ = s2["foo"] // expected-error {{cannot subscript a value of type 'SubscriptTest2' with an argument of type 'String'}}
322322
// expected-note @-1 {{overloads for 'subscript' exist with these partially matching parameter lists: (String, Int), (String, String)}}
323323

324-
let a = s2["foo", 1.0] // expected-error {{cannot subscript a value of type 'SubscriptTest2' with an index of type '(String, Double)'}}
324+
let a = s2["foo", 1.0] // expected-error {{cannot subscript a value of type 'SubscriptTest2' with an argument of type '(String, Double)'}}
325325
// expected-note @-1 {{overloads for 'subscript' exist with these partially matching parameter lists: (String, Int), (String, String)}}
326326

327327
_ = s2.subscript("hello", 6)

test/type/types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var d3 : () -> Float = { 4 }
1919
var d4 : () -> Int = { d2 } // expected-error{{function produces expected type 'Int'; did you mean to call it with '()'?}} {{26-26=()}}
2020

2121
var e0 : [Int]
22-
e0[] // expected-error {{cannot subscript a value of type '[Int]' with an index of type '()'}}
22+
e0[] // expected-error {{cannot subscript a value of type '[Int]' with an argument of type '()'}}
2323
// expected-note @-1 {{overloads for 'subscript' exist with these partially matching parameter lists: ((UnboundedRange_) -> ()), (Int), (R), (Range<Int>), (Range<Self.Index>)}}
2424

2525
var f0 : [Float]

0 commit comments

Comments
 (0)