Commit Graph

105 Commits

Author SHA1 Message Date
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
Max Moiseev
182e721afc [overlay] Adding CoreMedia dependency to the CoreImage overlay 2016-07-19 15:52:58 -07:00
Luke Larson
74e0498015 Revert "Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs."
This reverts commit 62d1fa760c.
2016-07-19 15:18:17 -07:00
Mishal Shah
62d1fa760c Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-07-19 22:31:34 +02:00
Max Moiseev
2facb335bf [overlay] A tentative fix for the intermittent build failures.
It looks from the failed build logs that XCTest has a transitive
dependency on CoreMedia, so listing this dependency explicitly might
solve the problem.
rdar://problem/27404152
2016-07-18 16:14:40 -07:00
Chris Lattner
af30ae3222 Remove the last parts of the Boolean protocol, finishing up:
SE-0109: Remove the Boolean protocol.

We still love you George, even if we forgot your e.
2016-07-17 22:18:17 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
Nicola Salmoria
956b6b1cad SR-1417: Add non-optional overloads of XCTAssertEqual and XCTAssertNotEqual
Previously, the only version of the functions that accepted values was the one that implicitly wraps them into Optionals. This generated a confusing error message when the assert failed. Having a separate overload that accepts non-optional types ensures that the correct description is printed when the assert fails.
2016-05-31 08:16:02 -04:00
John McCall
50d58b2732 Add a lot of calling-convention annotations to the standard library / runtime.
The general rule here is that something needs to be SWIFT_CC(swift)
if it's just declared in Swift code using _silgen_name, as opposed to
importing something via a header.

Of course, SWIFT_CC(swift) expands to nothing by default for now, and
I haven't made an effort yet to add the indirect-result / context
parameter ABI attributes.  This is just a best-effort first pass.

I also took the opportunity to shift a few files to just implement
their shims header and to demote a few things to be private stdlib
interfaces.
2016-05-04 10:31:23 -07:00
Chris Lattner
4fd8418ba7 move the stdlib to put noescape and autoclosure on the type, instead of
the parameter.  Progress towards SE-0049.
2016-04-14 23:13:43 -07:00
Harlan
2d50e81347 Updated lingering XCTest argument labels
This should be the last of the SE-0046 XCTest changes
2016-04-07 14:08:50 -07:00
Harlan Haskins
706230ff7d Fixed XCTAssert argument labels 2016-04-07 13:43:44 -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
Jordan Rose
b71f7440f0 stdlib: Rename cases in XCTest._XCTThrowableBlockResult.
This is a non-public enum, so there's no migration needed.
2016-02-24 17:46:11 -08:00
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -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
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Chris Lattner
0619e57a61 Switch the stdlib to use #file instead of __FILE__, and deprecate the __FILE__ identifiers.
This also updates the tests that would otherwise fail.
2016-02-04 15:08:31 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Chris Hanson
d2e5887469 XCTest Overlay: Treat ObjC exceptions as unexpected failures
When an assertion fails due to an Objective-C exception, that should be
treated as an unexpected failure, not an expected failure.

Addresses rdar://problem/24114025.
2016-01-15 16:37:48 -08:00
Chris Hanson
0e904b76a0 XCTest Overlay: Allow assertion expressions to throw
When an assertion expression throws an error, treat that as an
unexpected failure of the assertion.

Also generate the failure message for the error directly in the overlay,
rather than routing through _XCTFailureDescription, to avoid revlock
between the overlay and XCTest.framework's implementation.

Addresses rdar://problem/23789893.
2016-01-14 12:57:06 -08:00
Chris Hanson
bf6d7ada84 XCTest Overlay: Add XCTAssertThrowsError assertion
Add an assertion that can be used to check that an expression throws an
error, and if it does to run a block against that error which may
contain further checks.

Addresses rdar://problem/23789904.
2016-01-14 11:58:12 -08:00
Max Moiseev
08e1e4a043 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-11 16:51:11 -08:00
Pavel Mazurin
e0c6ac167c Add @autoclosure to message parameter, so it's constructed only if it's needed. 2016-01-08 20:49:48 +01:00
Brian Croom
a5ae9ddabe Use StaticString for file parameters in the XCTest overlay
Instead of just `String`. This makes it consistent with `fatalError`,
`assert`, etc., as well as `swift-corelibs-xctest`
2016-01-05 16:24:50 -05: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
Joe Groff
8edde2c503 Runtime: Push swift_demangleSimpleClass into XCTest overlay.
The only place it's used.
2015-12-23 11:19:42 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Maxim Moiseev
ca932fca5a CVarArgType => CVarArg 2015-12-16 15:52:01 -08:00
Maxim Moiseev
50fba4b770 floating point types renamed 2015-12-10 17:05:11 -08:00
Maxim Moiseev
2c95bb6d51 BooleanType => Boolean 2015-12-10 14:56:32 -08:00
Jawwad Ahmad
8f6f5ab0dd [stdlib] Remove trailing semicolons from files in stdlib 2015-12-04 15:50:13 +05:00
Joe Groff
fbd2e4d872 Rename @asmname to @_silgen_name.
This reflects the fact that the attribute's only for compiler-internal use, and isn't really equivalent to C's asm attribute, since it doesn't change the calling convention to be C-compatible.
2015-11-17 14:13:48 -08:00
Jordan Rose
6e1bf0d10d Rename @exported to @_exported for now.
At some point I want to propose a revised model for exports, but for now
just mark that support for '@exported' is still experimental and subject
to change. (Thanks, Max.)
2015-11-05 11:59:00 -08:00
Jordan Rose
53b1cf2b09 [CMake] Fix dependencies for CloudKit.
...which unfortunately meant splitting tvOS out from iOS.

Swift SVN r31343
2015-08-19 20:57:02 +00:00
Zoltan Foley-Fisher
4f87b6e8c5 Fix <rdar://problem/18063644> [SWIFT] XCTAssert(Non)Nil should work on any optional type
Swift SVN r30813
2015-07-30 20:40:10 +00:00
Zoltan Foley-Fisher
4a3b5bada3 <rdar://problem/17541074> [SWIFT] Should XCTAssertEqual and friends take optional/nullable types?
Now comparing optionals in XCTAssertEqual/XCTAssertNotEqual

Swift SVN r30516
2015-07-22 23:42:37 +00:00
Doug Gregor
17884f173a Stop declaring function parameters without names, e.g., "func f(Int)".
Swift SVN r29607
2015-06-24 16:01:31 +00:00
Jordan Rose
99768eb346 Revert "Switch overlays from using @exported to -import-underlying-module."
This reverts r29441 because it breaks the Linux build. I'll talk to Dmitri
about this tomorrow.

See rdar://problem/21254367

Swift SVN r29444
2015-06-17 05:02:21 +00:00
Jordan Rose
c8bfc87c4e Switch overlays from using @exported to -import-underlying-module.
Some day we'll close the hole for @exported in the previous commit.

Swift SVN r29441
2015-06-17 04:48:06 +00:00
Dmitri Hrybenko
29ec6ab6b5 Re-enable the XCTest overlay for OSX
And add the first smoketest for the XCTest overlay to prevent
regressions in future.

Swift SVN r29197
2015-06-01 01:09:31 +00:00
Dmitri Hrybenko
e878cdc153 Don't build the XCTest overlay for watchOS
XCTest for watchOS is not present in the public SDK.

Swift SVN r29156
2015-05-29 23:47:35 +00:00
Doug Gregor
d1c25ddeb9 Add missing dependency: XCTest depends on AppKit or UIKit.
Swift SVN r28947
2015-05-23 03:40:35 +00:00
Chris Lattner
c1df892d47 improve stdlib hygiene a bit.
Swift SVN r28392
2015-05-10 02:55:18 +00:00
David Farler
8c2248a482 Don't embed LLVM bitcode into the XCTest overlay
With bitcode enabled, the XCTest overlay fails to link because
XCTest.framework itself was not built with bitcode. For now, we should
not build this overlay with bitcode. It isn't embedded in apps.

rdar://problem/20884313

Swift SVN r28355
2015-05-09 01:28:05 +00:00
Chris Lattner
31c01eab73 Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler
includes a number of QoI things to help people write the correct code.  I will commit
the testcase for it as the next patch.

The bulk of this patch is moving the stdlib, testsuite and validation testsuite to
the new syntax.  I moved a few uses of "as" patterns back to as? expressions in the 
stdlib as well.



Swift SVN r27959
2015-04-30 04:38:13 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00