Commit Graph

7 Commits

Author SHA1 Message Date
Dmitri Gribenko
c9041beea3 Migrate callsites from 'expectNotEmpty()' to 'expectNotNil()' 2016-09-10 20:05:43 -07:00
Dmitri Gribenko
1425a9201d Foundation tests: simplify some tests using the new expectEqual() assertions 2016-08-08 17:56:08 -07:00
Jordan Rose
f42158b12e Revert "[Sema] ban multi-arguments to tuple coercion" (#3922)
It breaks cases where there really is a single unlabeled argument of tuple type, like this:

  let pairs = [(1, "A"), (2, "B")]
  print(pairs.map { $0.0 })
2016-08-01 19:22:19 -07:00
Daniel Duan
c9b73dacc2 [Sema] ban multi-arguments to tuple coercion
Implements part of SE-0110. Single argument in closures will not be accepted if
there exists explicit type with a number of arguments that's not 1.

```swift
let f: (Int, Int) -> Void = { x in } // this is now an error
```

Note there's a second part of SE-0110 which could be considered additive,
which says one must add an extra pair of parens to specify a single arugment
type that is a tuple:

```swift
let g ((Int, Int)) -> Void = { y in } // y should have type (Int, Int)
```

This patch does not implement that part.
2016-07-31 16:22:57 -07:00
Robert Widmann
e1ae0391e8 Fixup validation tests 2016-07-30 03:50:16 -07:00
Robert Widmann
7ad2620f5b Keep cleaning up 2016-07-28 18:50:22 -07:00
Dmitri Gribenko
a3254b7990 Foundation: add custom AnyHashable representations to NSNumber and NSString
We want NSNumbers bridged from Swift types to bridge back to the same
Swift type.
2016-07-26 03:10:52 -07:00