Skip to content

Commit 612991e

Browse files
committed
Add two test cases with an unclear diagnostics
1 parent cec85b7 commit 612991e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

test/Constraints/diagnostics.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,4 +777,7 @@ class SR1594 {
777777
}
778778
}
779779

780-
780+
// FIXME: Bad diagnostic
781+
func secondArgumentNotLabeled(a:Int, _ b: Int) { }
782+
secondArgumentNotLabeled(10, 20)
783+
// expected-error@-1 {{argument '_' must precede unnamed parameter #0}}

test/Generics/invalid.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,11 @@ func badDiagnostic2() {
7171
// expected-note@-2 {{overloads for 'eatDinnerConcrete' exist with these partially matching parameter lists: (d: Pizzas<ChiliFlakes>.NewYork, t: Deli<ChiliFlakes>.Pepperoni), (d: Pizzas<Pepper>.DeepDish, t: Deli<Pepper>.Pepperoni)}}
7272

7373
}
74+
75+
// Real error is that we cannot infer the generic parameter from context
76+
77+
func takesAny(_ a: Any) {}
78+
79+
func badDiagnostic3() {
80+
takesAny(Deli.self) // expected-error {{argument type 'Deli<_>.Type' does not conform to expected type 'Any' (aka 'protocol<>')}}
81+
}

0 commit comments

Comments
 (0)