Files
swift-mirror/test/Generics/materializable_restrictions.swift
Alex Hoppen f35f29d9cf [Diag] Change function diagnostics to take a DeclName parameter
This provides richer error messages that include the function's
parameters
2017-07-01 13:37:08 +02:00

25 lines
628 B
Swift

// RUN: %target-typecheck-verify-swift
func test15921520() {
var x: Int = 0
func f<T>(_ x: T) {} // expected-note{{in call to function 'f'}}
f(&x) // expected-error{{generic parameter 'T' could not be inferred}}
}
func test20807269() {
var x: Int = 0
func f<T>(_ x: T) {}
f(1, &x) // expected-error{{extra argument in call}}
}
func test15921530() {
struct X {}
func makef<T>() -> (T) -> () { // expected-note {{in call to function 'makef()'}}
return {
x in ()
}
}
var _: (inout X) -> () = makef() // expected-error{{generic parameter 'T' could not be inferred}}
}