Files
swift-mirror/test/Generics/materializable_restrictions.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

25 lines
626 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}}
}