Commit Graph

19 Commits

Author SHA1 Message Date
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Joe Groff
62afa03eb9 Improve Foundation overlay to handle bridging subscripts and dictionary literals.
SE-0072 took implicit bridging conversions away, which regressed the ability to express NSDictionaries as dictionary literals and index them using literal keys. Address this by changing the signature of init(dictionaryLiteral:) to use Hashable and Any, and by replacing the subscript from Objective-C with one using _Hashable that does the bridging on the user's behalf. This largely restores the QoI of working with NS collections.
2016-08-04 08:42:36 -07:00
Joe Groff
11f03cd8b5 Sema: Don't try bridged classes as default literal types.
One last bit of SE-0072. We shouldn't fall back to bridged classes in the absence of type context for literals anymore. By itself, this kind of hoses the use of literals with NS types, but I think we can get most of the QoI back with overlay changes I plan to propose following this.
2016-07-29 15:18:31 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
David Farler
9aa7663ad3 Always debugPrint containers' elements
rdar://problem/19312992

Swift SVN r31067
2015-08-07 06:14:19 +00:00
Joe Pamer
828eb68e72 Commit DaveA's API changes to 'print', along with the compiler changes necessary to support them.
There's still work left to do. In terms of next steps, there's still rdar://problem/22126141, which covers removing the 'workaround' overloads for print (that prevent bogus overload resolution failures), as well as providing a decent diagnostic when users invoke print with 'appendNewline'.

Swift SVN r30976
2015-08-04 01:57:11 +00:00
Arnold Schwaighofer
859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Dave Abrahams
d47835a301 Robustify test/Interpreter/SDK/objc_switch.swift
Tests were written such that FileCheck could easily mis-report the wrong
thing as failing.

Swift SVN r22494
2014-10-03 15:50:45 +00:00
Doug Gregor
bb02b85e74 Implicitly introduce .Some(x) to balance out optionals in is/as patterns.
This allows us to switch on an optional value and match it to concrete
values without explicitly writing the ".Some"'s. Better testing to follow...

Swift SVN r21018
2014-08-04 17:01:53 +00:00
Jordan Rose
5197f3c506 [test] Don't assume Dictionary contents are ordered.
Swift SVN r21000
2014-08-04 07:00:40 +00:00
Doug Gregor
1c484d91a0 Allow bridging "as" patterns in switch cases <rdar://problem/17408934>.
We now allow switches like this:

  switch anyObject {
  case let str as String: // bridged via NSString
    println(str) 

  case let intArr as [Int]: // bridged via NSArray
    println(intArr)

  default:
  }

Note that we do not allow collection downcasting in switch statements
(yet); that's covered by <rdar://problem/17897378>.



Swift SVN r20976
2014-08-03 19:58:49 +00:00
Joe Pamer
94dac129d4 Remove the BooleanType conformance from optional types (rdar://problem/17110911)
To limit user confusion when using conditional expressions of type Bool?, we've decided to remove the BooleanType (aka "LogicValue") conformance from optional types. (If users would like to use an expression of type Bool? as a conditional, they'll need to check against nil.)

Note: This change effectively regresses the "case is" pattern over types, since it currently demands a BooleanType conformance. I've filed rdar://problem/17791533 to track reinstating it if necessary.

Swift SVN r20637
2014-07-28 19:20:39 +00:00
Doug Gregor
4c49802c15 Drop the ~= overload for NSObject <rdar://problem/17639977>.
Swift SVN r20254
2014-07-21 15:32:06 +00:00
Doug Gregor
9210cd5ff4 Replace T[] array syntax with [T] in the test suite
Swift SVN r19192
2014-06-25 23:39:24 +00:00
Doug Gregor
2b8923e3ef Allow "isa" patterns to downcast collections and bridge through Objective-C classes.
When checking an isa pattern that requires either collection
downcasting or bridging through an Objective-C class (e.g., 
"is String" or "is Dictionary<String, Int>"), form a conditional
downcast and place it in an expression pattern.

With this change, we can test for these cases (with "is") but we can't
capture the value produced on success (e.g., for "let str as
String"). This is a first small step toward <rdar://problem/17408934>.


Swift SVN r19070
2014-06-21 22:46:15 +00:00