mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Most tests were using %swift or similar substitutions, which did not include the target triple and SDK. The driver was defaulting to the host OS. Thus, we could not run the tests when the standard library was not built for OS X. Swift SVN r24504
26 lines
757 B
Swift
26 lines
757 B
Swift
// RUN: %target-parse-verify-swift
|
|
// RUN: %target-parse-verify-swift
|
|
|
|
func unconstrained<T>(x: T) {}
|
|
|
|
var x = 0
|
|
var y = "one"
|
|
|
|
// Although the generic parameter is unconstrained, it can only be bound to
|
|
// a materializable type. This should resolve T = Int and load the @lvalue x.
|
|
unconstrained(x)
|
|
// Although the generic parameter is unconstrained, it can only be bound to
|
|
// This should resolve T = (Int, String) and load the (@lvalue x, @lvalue y)
|
|
// tuple.
|
|
// FIXME: There's an inconsistency here in call argument matching between
|
|
// rvalues and lvalues. <rdar://problem/17786730>
|
|
unconstrained((x, y))
|
|
unconstrained(x, y) // expected-error{{extra argument in call}}
|
|
|
|
|
|
let a = 0
|
|
let b = "one"
|
|
unconstrained(a)
|
|
unconstrained((a, b))
|
|
unconstrained(a, b)
|