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
Copy file name to clipboardExpand all lines: test/Constraints/diagnostics.swift
+17-12Lines changed: 17 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -170,11 +170,7 @@ func rdar20142523() {
170
170
// <rdar://problem/21080030> Bad diagnostic for invalid method call in boolean expression: (_, ExpressibleByIntegerLiteral)' is not convertible to 'ExpressibleByIntegerLiteral
171
171
func rdar21080030(){
172
172
vars="Hello"
173
-
// https://github.com/apple/swift/issues/50141
174
-
// This should be 'cannot_call_non_function_value'.
175
-
if s.count()==0{}
176
-
// expected-error@-1 {{generic parameter 'E' could not be inferred}}
177
-
// expected-error@-2 {{missing argument for parameter 'where' in call}}
173
+
if s.count()==0{} // expected-error {{cannot call value of non-function type 'Int'}}
178
174
}
179
175
180
176
// <rdar://problem/21248136> QoI: problem with return type inference mis-diagnosed as invalid arguments
@@ -1537,9 +1533,7 @@ func issue63746() {
1537
1533
}
1538
1534
1539
1535
func rdar86611718(list:[Int]){
1540
-
String(list.count())
1541
-
// expected-error@-1 {{missing argument for parameter 'where' in call}}
1542
-
// expected-error@-2 {{generic parameter 'E' could not be inferred}}
1536
+
String(list.count()) // expected-error {{cannot call value of non-function type 'Int'}}
1543
1537
}
1544
1538
1545
1539
// rdar://108977234 - failed to produce diagnostic when argument to AnyHashable parameter doesn't conform to Hashable protocol
let _ ="" /* This is a comment */ ??"" // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{13-43=}}
1559
1553
1560
1554
let _ ="" // This is a comment
1561
-
??"" // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1560:13-1561:10=}}
1555
+
??"" // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1554:13-1555:10=}}
1562
1556
1563
1557
let _ ="" // This is a comment
1564
1558
/*
1565
1559
* The blank line below is part of the test case, do not delete it
1566
1560
*/
1567
-
??"" // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1563:13-1567:10=}}
1561
+
??"" // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1557:13-1561:10=}}
1568
1562
1569
-
if(""?? // This is a comment // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{9-1570:9=}}
1563
+
if(""?? // This is a comment // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{9-1564:9=}}
1570
1564
"").isEmpty {}
1571
1565
1572
1566
if("" // This is a comment
1573
-
??"").isEmpty {} // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1572:9-1573:12=}}
1567
+
??"").isEmpty {} // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}} {{1566:9-1567:12=}}
0 commit comments