You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Diagnostics] Fix fix-it location for labeled tuple splat
In situations like this:
```swift
func foo(x: (Int, Int) {}
foo(x: 0, 0)
```
Left paren to form a missing tuple should be placed after
the label because belongs to the parameter and not the tuple.
Copy file name to clipboardExpand all lines: test/Constraints/tuple_arguments.swift
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ do {
74
74
generic((3,4))
75
75
76
76
genericLabeled(x:3)
77
-
genericLabeled(x:3,4) // expected-error {{global function 'genericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{18-18=(}} {{25-25=)}}
77
+
genericLabeled(x:3,4) // expected-error {{global function 'genericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{20-20=(}} {{25-25=)}}
78
78
genericLabeled(x:(3))
79
79
genericLabeled(x:(3,4))
80
80
@@ -261,7 +261,7 @@ do {
261
261
s.generic((3,4))
262
262
263
263
s.genericLabeled(x:3)
264
-
s.genericLabeled(x:3,4) // expected-error {{instance method 'genericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{20-20=(}} {{27-27=)}}
264
+
s.genericLabeled(x:3,4) // expected-error {{instance method 'genericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{22-22=(}} {{27-27=)}}
265
265
s.genericLabeled(x:(3))
266
266
s.genericLabeled(x:(3,4))
267
267
@@ -395,7 +395,7 @@ do {
395
395
s.mutatingGeneric((3,4))
396
396
397
397
s.mutatingGenericLabeled(x:3)
398
-
s.mutatingGenericLabeled(x:3,4) // expected-error {{instance method 'mutatingGenericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{28-28=(}} {{35-35=)}}
398
+
s.mutatingGenericLabeled(x:3,4) // expected-error {{instance method 'mutatingGenericLabeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{30-30=(}} {{35-35=)}}
399
399
s.mutatingGenericLabeled(x:(3))
400
400
s.mutatingGenericLabeled(x:(3,4))
401
401
@@ -932,7 +932,7 @@ do {
932
932
_ =GenericInit(3,4) // expected-error {{initializer expects a single parameter of type 'T' [with T = (Int, Int)]}} {{19-19=(}} {{23-23=)}}
933
933
_ =GenericInit((3,4))
934
934
935
-
_ =GenericInitLabeled(x:3,4) // expected-error {{initializer expects a single parameter of type 'T' [with T = (Int, Int)]}} {{26-26=(}} {{33-33=)}}
935
+
_ =GenericInitLabeled(x:3,4) // expected-error {{initializer expects a single parameter of type 'T' [with T = (Int, Int)]}} {{28-28=(}} {{33-33=)}}
936
936
_ =GenericInitLabeled(x:(3,4))
937
937
938
938
_ =GenericInitTwo(3,4)
@@ -1060,7 +1060,7 @@ do {
1060
1060
_ =s1[(3.0,4.0)]
1061
1061
1062
1062
lets1a=GenericSubscriptLabeled<(Double,Double)>()
1063
-
_ =s1a[x:3.0,4.0] // expected-error {{subscript expects a single parameter of type '(Double, Double)'}} {{12-12=(}} {{23-23=)}}
1063
+
_ =s1a[x:3.0,4.0] // expected-error {{subscript expects a single parameter of type '(Double, Double)'}} {{14-14=(}} {{23-23=)}}
1064
1064
_ =s1a[x:(3.0,4.0)]
1065
1065
1066
1066
lets2=GenericSubscriptTwo<Double>()
@@ -1072,7 +1072,7 @@ do {
1072
1072
_ =s3[(3.0,4.0)]
1073
1073
1074
1074
lets3a=GenericSubscriptLabeledTuple<Double>()
1075
-
_ =s3a[x:3.0,4.0] // expected-error {{subscript expects a single parameter of type '(Double, Double)'}} {{11-11=(}} {{22-22=)}}
1075
+
_ =s3a[x:3.0,4.0] // expected-error {{subscript expects a single parameter of type '(Double, Double)'}} {{13-13=(}} {{22-22=)}}
1076
1076
_ =s3a[x:(3.0,4.0)]
1077
1077
}
1078
1078
@@ -1130,7 +1130,7 @@ do {
1130
1130
_ =GenericEnum.one(3,4) // expected-error {{enum case 'one' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{23-23=(}} {{27-27=)}}
1131
1131
_ =GenericEnum.one((3,4))
1132
1132
1133
-
_ =GenericEnum.labeled(x:3,4) // expected-error {{enum case 'labeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{27-27=(}} {{34-34=)}}
1133
+
_ =GenericEnum.labeled(x:3,4) // expected-error {{enum case 'labeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{29-29=(}} {{34-34=)}}
1134
1134
_ =GenericEnum.labeled(x:(3,4))
1135
1135
_ =GenericEnum.labeled(3,4) // expected-error {{enum case 'labeled' expects a single parameter of type 'T' [with T = (Int, Int)]}} {{27-27=(}} {{31-31=)}}
1136
1136
_ =GenericEnum.labeled((3,4)) // expected-error {{missing argument label 'x:' in call}}
@@ -1265,7 +1265,7 @@ do {
1265
1265
sTwo.requirement(3.0,4.0) // expected-error {{instance method 'requirement' expects a single parameter of type 'GenericConforms<(Double, Double)>.Element' (aka '(Double, Double)')}} {{20-20=(}} {{28-28=)}}
1266
1266
sTwo.requirement((3.0,4.0))
1267
1267
1268
-
sTwo.requirementLabeled(x:3.0,4.0) // expected-error {{instance method 'requirementLabeled' expects a single parameter of type 'GenericConforms<(Double, Double)>.Element' (aka '(Double, Double)')}} {{27-27=(}} {{38-38=)}}
1268
+
sTwo.requirementLabeled(x:3.0,4.0) // expected-error {{instance method 'requirementLabeled' expects a single parameter of type 'GenericConforms<(Double, Double)>.Element' (aka '(Double, Double)')}} {{29-29=(}} {{38-38=)}}
0 commit comments