Skip to content

Commit

Permalink
Add two test cases with an unclear diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
slavapestov committed Jun 23, 2016
1 parent cec85b7 commit 612991e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/Constraints/diagnostics.swift
Expand Up @@ -777,4 +777,7 @@ class SR1594 {
}
}


// FIXME: Bad diagnostic
func secondArgumentNotLabeled(a:Int, _ b: Int) { }
secondArgumentNotLabeled(10, 20)
// expected-error@-1 {{argument '_' must precede unnamed parameter #0}}
8 changes: 8 additions & 0 deletions test/Generics/invalid.swift
Expand Up @@ -71,3 +71,11 @@ func badDiagnostic2() {
// 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)}}

}

// Real error is that we cannot infer the generic parameter from context

func takesAny(_ a: Any) {}

func badDiagnostic3() {
takesAny(Deli.self) // expected-error {{argument type 'Deli<_>.Type' does not conform to expected type 'Any' (aka 'protocol<>')}}
}

0 comments on commit 612991e

Please sign in to comment.