Commit Graph

58 Commits

Author SHA1 Message Date
Max Moiseev
0490e86d01 [stdlib] strideTo/strideThrough => stride(to:...)/stride(through:...) 2016-02-24 09:56:10 -08:00
Dave Abrahams
64a5165ecf stdlib: deinitializePointee(_) => deinitialize()
Tacking "Pointee" on just for unary operations (and especially
operations with an optional count) created inconsistency.
2016-02-23 15:34:20 -08:00
Dave Abrahams
d96b051d28 stdlib: initializePointee(_) => initialize(with:)
Tacking "Pointee" on just for unary operations (and especially
operations with an optional count) created inconsistency.
2016-02-23 15:15:23 -08:00
Dmitri Gribenko
63481be8bd stdlib: lowercase cases of the PlaygroundQuickLook enum 2016-02-20 00:55:35 -08:00
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Max Moiseev
55fde4c923 making tests pass 2016-02-10 16:08:40 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Austin Zheng
77918a86ac [SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
2016-01-27 20:40:52 -08:00
Andrew Trick
182bb7f812 Revert "Merge pull request #1058 from austinzheng/az-port-mirror"
This pull request broke the following tests on several build configurations
(eg --preset=buildbot,tools=RA,stdlib=DA)

    1_stdlib/Reflection.swift
    1_stdlib/ReflectionHashing.swift
    1_stdlib/UnsafePointer.swift.gyb

This reverts commit c223a3bf06, reversing
changes made to 5c2bb09b09.
2016-01-27 10:43:08 -08:00
Austin Zheng
10d5b23c30 [SR-88] Reinstate mirror migration commit
Changes:
- Reverted commit reverting original SR-88 commit
- Removed mirror children helper collections and related code
- Rewrote some tests to keep them working properly
- Wrote two more tests for the three pointer APIs to ensure no crashes if created using a value > Int64.max

This reverts commit 8917eb0e5a.
2016-01-26 19:28:32 -08:00
Mark Lacey
8917eb0e5a Revert "[Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()"
This reverts commit 9798dfd4aa because it
broke the stdlib build.
2016-01-22 08:41:07 -08:00
Austin Zheng
9798dfd4aa [Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()
Jira: SR-88
Changes:
- Removed stdlib type conformances to _Reflectable
- Conformed stdlib types to CustomReflectable, CustomPlaygroundQuickLookable
- Rewrote dump() function to not use _reflect()
- CGRect, CGPoint, CGSize now conform to CustomDebugStringConvertible
- Rewrote unit tests for compatibility with new API
2016-01-21 09:44:15 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
ken0nek
3ac60b13f5 Add spaces before and after closure arrow in test 2015-12-23 04:38:46 +09:00
Max Moiseev
bc942090ee cleaning up initializePointee/deinitializePointee, error messages and comments 2015-12-18 16:22:24 -08:00
Dmitri Gribenko
5498aa1938 stride(to:by:) => strideTo(_:by:)
and `stride(through:by:)` => `strideThrough(_:by:)`
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
6b2ad53f80 Remove no-arg initializers from Optional and IOU
We prefer 'nil' to be used instead.
2015-12-17 16:28:08 -08:00
Maxim Moiseev
6c50752aed UnsafePointer: initializeMemory and deinitializePointee 2015-12-16 17:11:57 -08:00
Dmitri Gribenko
3d0ad16094 Unsafe[Mutable]Pointer.memory => .pointee 2015-12-16 15:50:31 -08:00
Dmitri Gribenko
f1dbe205a3 UnsafeMutablePointer.dealloc(_:) => .deallocateCapacity(_:) 2015-12-16 15:47:58 -08:00
Dmitri Gribenko
1f70e25899 UnsafeMutablePointer.alloc(_:) => UnsafeMutablePointer(allocatingCapacity:) 2015-12-16 15:45:48 -08:00
Dmitri Gribenko
7971a67ee0 Remove Bit 2015-12-16 14:46:26 -08:00
Jordan Rose
83e2e0bbb2 Move the 'stride' family into methods on Strideable.
Part of the Protocol Extensions TLF.

rdar://problem/22085144

Swift SVN r30974
2015-08-04 01:32:41 +00:00
Joe Groff
2bae64c18f Remove accidentally-reintroduced tests.
Swift SVN r30175
2015-07-13 23:17:37 +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
Slava Pestov
ff69c54d9d Updating enum reflection tests for new style
Part of <rdar://problem/21739870>, since we can't add new tests
to the old Reflection.swift anymore.

Swift SVN r30133
2015-07-13 00:20:40 +00:00
Dmitri Hrybenko
9da16e592e stdlib: underscore reflect() and unsafeReflect()
Part of removing the old mirrors.

rdar://21428474

Swift SVN r29826
2015-07-01 00:31:39 +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
Dave Abrahams
1175d3602c [stdlib] Underscore the legacy Reflectable protocol
We don't want anyone using this and hope to remove it before GM, so
let's at least make its imminent death more obvious.

Swift SVN r29075
2015-05-27 20:59:24 +00:00
Enrico Granata
8a5726d966 Revert 28997
The consensus is against this change and we're going for a much more targeted fix in PlaygroundLogger only



Swift SVN r28999
2015-05-24 23:16:57 +00:00
Enrico Granata
05a038e818 Make it so that the runtime demangler does not print the Swift standard library module name
This changes things like Swift.Dictionary<Swift.Int, Swift.AnyObject> to Dictionary<Int, AnyObject>

It has been suggested that playgrounds would benefit from not showing the fully qualified name.
Playgrounds use the runtime demangler to obtain type names, and honestly, I do not see enough value in those qualifiers being printed out to justify hackery in PlaygroundLogger or separate demangling logic



Swift SVN r28997
2015-05-24 22:25:12 +00:00
Slava Pestov
6bd9b399e9 stdlib: Tweak how empty enum cases are printed
Previously a mirror for an empty case would have one entry, consisting
of the case name and a value of ().

Now, the mirror's summary shows both the type and the case.  If there is
no payload, the mirror will not have any children. The presence of a
child indicates there is an actual payload.

Also put a non-ASCII character in the reflection test to ensure the
runtime's primitives can round-trip UTF8.

Fixes <rdar://problem/20994093>.

Swift SVN r28874
2015-05-21 16:01:47 +00:00
Dmitri Hrybenko
adf7bcac0e tests: stop subclassing SKScene in non-GUI apps
Subclassing SKScene in a CLI app does not work in the newer SDK.

Swift SVN r28740
2015-05-19 01:55:32 +00:00
Slava Pestov
fc3f4907de Runtime: get some multi-payload enum reflection
It will bail out for some multi-payload enums but should be good
enough for an Either<T> { case Left(T); case Right(ErrorType) }

Swift SVN r28479
2015-05-12 18:19:35 +00:00
Slava Pestov
d2a5fbd94a Implement reflection on instances of empty and single-payload enums
This change attempts to introduce the functionality without being too
disruptive. After we branch, I want to consolidate some of the runtime
functions and implement this functionality for multi-payload enums
as well, which requires adding new runtime metadata.

Example:

(swift) enum Color { case Red, Green, Blue(Int) }
(swift) print(Color.Red)
REPL.Color.Red
(swift) print(Color.Blue(5))
REPL.Color.Blue(5)

Implements <rdar://problem/18334936>.

Swift SVN r28430
2015-05-11 18:21:39 +00:00
Slava Pestov
d39531620d stdlib tests: Split off Reflection_objc.swift from Reflection.swift
Swift SVN r28429
2015-05-11 18:21:38 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Greg Parker
12a3879e6c [test] Fix 1_stdlib/Reflection.swift for iOS (NSResponder => UIResponder).
Swift SVN r28164
2015-05-05 09:43:03 +00:00
Dave Abrahams
65be672a0c [stdlib] Adjust expected output of legacy mirror tests
Now that we're reflecting base classes, things have changed a bit.

Swift SVN r28160
2015-05-05 07:43:49 +00:00
Chris Willmore
98d17e318d Add support for AppleTV simulator tests.
You can run tests with e.g. 'ninja check-swift-appletvsimulator-x86_64'.

Swift SVN r27297
2015-04-14 23:53:03 +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
Dmitri Hrybenko
ff2dd6320a stdlib: fix coding style
When colon specifies is-a relationship between types, we put spaces on
both sides of the colon.

Swift SVN r27016
2015-04-05 05:54:55 +00:00
Dmitri Hrybenko
ab408d4dc3 Update the compiler and SDK overlay for nullability and generics in Foundation
We have an SPI between the Swift compiler and Foundation based on the
SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH preprocessor macro that allows us to
request the new API.  rdar://20270080 tracks removing it.

Swift SVN r26475
2015-03-24 02:18:06 +00:00
Maxwell Swadling
266acda5bc moved reflection test to Runtime.swift
Swift SVN r25207
2015-02-11 23:41:59 +00:00
Maxwell Swadling
ac5e78ddf4 added reflection on null pointer test
verifies rdar://problem/19708338 doesn't regress.

Swift SVN r25194
2015-02-11 21:28:22 +00:00
Joe Groff
af4dd5342f Runtime: Don't fall through into the wrong place when reflecting opaque values.
Fixes rdar://problem/19791252.

Swift SVN r25186
2015-02-11 19:02:44 +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