Commit Graph

30 Commits

Author SHA1 Message Date
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Hugh Bellamy
eaef92a203 Replace XFAIL with Requires for ArrayBridge
All code in ArrayBridge requires objc interop, so this is why it fails
on Linux
2016-03-05 15:53:02 +00:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
Chris Lattner
82e5c0c592 Update various tests to stop using ++/-- 2015-12-21 18:07:37 -08:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.

There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:

    Swift :: ClangModules/objc_parse.swift
    Swift :: Interpreter/SDK/Foundation_test.swift
    Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
    Swift :: Interpreter/SDK/objc_currying.swift

due to two independent remaining compiler bugs:
  * We're not getting partial ordering between NSCoder's
  encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
  that method, and
  * Dynamic lookup (into AnyObject) doesn't know how to find the new
  names. We need the Swift name lookup tables enabled to address this.
2015-12-11 14:46:50 -08:00
Jordan Rose
177588d1a8 Only allow collections to contain @objc types in @objc methods and properties.
We allow any array of bridgeable types to be converted to NSArray (and
similar for Dictionary and Set), but to be part of an API is a little
stricter. Previously, '[MySwiftObject]' as a parameter would get exposed
to Objective-C as 'NSArray *', but that's not type-safe at all---and in
corner cases, crashd in the ObjC printer. Now we just don't allow that.

On the plus side, '[Int]' is now exposed as 'NSArray<NSNumber *> *',
which is a fair amount better than just 'NSArray *'.

rdar://problem/19787270

Swift SVN r30719
2015-07-28 18:46:07 +00:00
Joe Groff
db0fea590e stdlib: Use unqualified names in 'print'.
Leave the qualification off of enum cases and type names when 'print'-ing them, but keep them on 'debugPrint'. (At least, at the outermost level; since ad-hoc printing of structs and tuples uses debugPrint, we'll still get qualification at depth, which kind of sucks but needs more invasive state management in print to make possible.) Implements rdar://problem/21788604.

Swift SVN r30166
2015-07-13 21:42:11 +00:00
Greg Parker
3ad022b89a [test] Revert r29558. ArrayBridge is not yet cleanly split objc vs non-objc.
Swift SVN r29560
2015-06-22 23:33:06 +00:00
Greg Parker
4317559e7c [test] 1_stdlib/ArrayBridge.swift requires objc_interop.
Swift SVN r29558
2015-06-22 22:54:10 +00:00
Greg Parker
fd5da7faf9 [test] Run an NSArray class method on a Swift array bridging class.
Swift SVN r29557
2015-06-22 22:45:07 +00:00
Joe Groff
d7b9ae72aa Sema: Require '.init' when constructing from a dynamic metatype.
This makes it clearer that expressions like "foo.myType.init()" are creating new objects, instead of invoking a weird-looking method. The last part of rdar://problem/21375845.

Swift SVN r29375
2015-06-14 19:50:06 +00:00
Arnold Schwaighofer
f7771859d8 Rename the optimize_test feature to executable_test and document that feature.
Swift SVN r29213
2015-06-01 23:44:13 +00:00
Arnold Schwaighofer
3643c614a3 Run tests in optimize test modes
This runs all files that have a target-build-swift or target-run-stdlib-swift
RUN line in optimize test mode.

Swift SVN r29206
2015-06-01 21:23:31 +00:00
Dmitri Hrybenko
ffe26aa69c stdlib: dissolve the Array.swift test in other tests
Swift SVN r29129
2015-05-29 01:33:07 +00:00
Greg Parker
15b99a26d9 Test: Add %target-clang substitution.
Swift SVN r28758
2015-05-19 06:08:36 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Dave Abrahams
ac3f047496 [stdlib] Renaming fallout from Mirror API review
toString(x)      => String(x)
toDebugString(x) => String(reflecting: x)
Printable        => CustomStringConvertible
DebugPrintable   => CustomDebugStringConvertible

Also updated comments to clarify these protocols

Swift SVN r27090
2015-04-07 20:32:26 +00:00
Doug Gregor
08f3470e65 Use 'dynamic' to make sure this is going through objc_msgSend.
Swift SVN r26830
2015-04-01 22:16:44 +00:00
Doug Gregor
9271a24a92 Introduce a protocol conformance registry for nominal types.
(Note that this registry isn't fully enabled yet; it's built so that
we can test it, but has not yet taken over the primary task of
managing conformances from the existing system).

The conformance registry tracks all of the protocols to which a
particular nominal type conforms, including those for which
conformance was explicitly specified, implied by other explicit
conformances, inherited from a superclass, or synthesized by the
implementation.

The conformance registry is a lazily-built data structure designed for
multi-file support (which has been a problematic area for protocol
conformances). It allows one to query for the conformances of a type
to a particular protocol, enumerate all protocols to which a type
conforms, and enumerate all of the conformances that are associated
with a particular declaration context (important to eliminate
duplicated witness tables).

The conformance registry diagnoses conflicts and ambiguities among
different conformances of the same type to the same protocol. There
are three common cases where we'll see a diagnostic:

1) Redundant explicit conformance of a type to a protocol:

    protocol P { }
    struct X : P {  }
    extension X : P { } // error: redundant explicit conformance

2) Explicit conformance to a protocol that collides with an inherited
  conformance:

    protocol P { }
    class Super : P { }
    class Sub : Super, P { } // error: redundant explicit conformance

3) Ambiguous placement of an implied conformance:

    protocol P1 { }
    protocol P2 : P1 { }
    protocol P3 : P1 { }

    struct Y { }
    extension Y : P2 { }
    extension Y : P3 { } // error: ambiguous implied conformance to 'P1'

  This happens when two different explicit conformances (here, P2 and
  P3) placed on different declarations (e.g., two extensions, or the
  original definition and other extension) both imply the same
  conformance (P1), and neither of the explicit conformances imply
  each other. We require the user to explicitly specify the ambiguous
  conformance to break the ambiguity and associate the witness table
  with a specific context.

Swift SVN r26067
2015-03-12 21:11:23 +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
Chris Willmore
68dd563fbf <rdar://problem/18311362> TLF: Eliminate implicit bridging conversions
Require 'as' when converting from Objective-C type to native type (but
continue to allow implicit conversion from native to Objective-C). This
conversion constraint is called ExplicitConversion; all implicit
conversions are covered by the existing Conversion constraint. Update
standard library and tests to match.

Swift SVN r24496
2015-01-18 00:07:45 +00:00
Chris Willmore
03a6190a1f <rdar://problem/19031957> Change failable casts from "as" to "as!"
Previously the "as" keyword could either represent coercion or or forced
downcasting. This change separates the two notions. "as" now only means
type conversion, while the new "as!" operator is used to perform forced
downcasting. If a program uses "as" where "as!" is called for, we emit a
diagnostic and fixit.

Internally, this change removes the UnresolvedCheckedCastExpr class, in
favor of directly instantiating CoerceExpr when parsing the "as"
operator, and ForcedCheckedCastExpr when parsing the "as!" operator.

Swift SVN r24253
2015-01-08 00:33:59 +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
Jordan Rose
e83c117c30 [test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.

Swift SVN r22745
2014-10-15 01:30:51 +00:00