Commit Graph

7859 Commits

Author SHA1 Message Date
Dave Abrahams
03f879bb87 [stdlib] Lazy flatMap
Addresses <rdar://problem/20138472>, can close after API review.

Swift SVN r30370
2015-07-18 06:50:27 +00:00
Dmitri Hrybenko
0fd6fd1f8f CoreMedia overlay: add an initializer CMTimeRange(start🔚)
rdar://20939243

Patch by Adam Sonnanstine + tests from me.

Swift SVN r30364
2015-07-18 03:35:08 +00:00
Joe Groff
6608221a72 stdlib: Remove _UnitTestArray.
rdar://problem/20246497

Swift SVN r30348
2015-07-18 00:14:28 +00:00
Dmitri Hrybenko
82ec7ea9d2 CoreMedia overlay: make CMTime Comparable, and CMTimeRange Equatable
Change approved by Adam Sonnanstine.

Swift SVN r30335
2015-07-17 22:26:58 +00:00
Slava Pestov
4e26069c8f Parse: Fix EndLoc of #if without #endif in parseDeclIfConfig(), and clean up duplication
Fixes <rdar://problem/19671208>.

Swift SVN r30314
2015-07-17 08:31:21 +00:00
Slava Pestov
c1b3569192 Parse: Fix crash with invalid protocol compositions, and improve error recovery
Fixes <rdar://problem/19686707>.

Swift SVN r30304
2015-07-17 05:57:22 +00:00
Slava Pestov
c83cc8ccd6 Parser: Fix a couple of crashes when parsing invalid enum cases
Also make some diagnostic wording more consistent.

Fixes <rdar://problem/19582394>.

Swift SVN r30300
2015-07-17 04:31:03 +00:00
Dmitri Hrybenko
109add8131 Foundation overlay: add NSCoder.decodeObjectOfClasses(_:forKey:)
Due to the fact that AnyClass is not Hashable, and that currently
NSKeyedArchiver/Unarchiver work with NSObject-derived, NSCoding
compliant classes, we are marking the decodeObjectOfClasses API refined
for Swift in our objc header and providing the desired overlay in our
overlay as shown below.

Arrays were also considered (for both API), but the underlying
implementation is entirely set-based, and using Arrays in Swift vs Sets
in objective C felt like too far a deviation.

Patch by Michael LeHew Jr.

Changes to the Dictionary test are caused by bumping the Fonudation API
epoch and taking in a fix in the types used in an NSDictionary
initializer.

rdar://21486551

Swift SVN r30297
2015-07-17 03:07:47 +00:00
Jordan Rose
7b37043857 Fix some but not all of the errors that had been fixed by the reverted commit.
...and regress a few cases that were previously passing. On the whole I think it's
a win, though.

Swift SVN r30296
2015-07-17 01:57:28 +00:00
Jordan Rose
2177a75b44 Revert "Validate decls before doing redeclaration checking."
It may fix a lot of crashers, but it breaks working code.

This reverts r30293.

Swift SVN r30294
2015-07-17 01:57:23 +00:00
Jordan Rose
6765a765a3 Validate decls before doing redeclaration checking.
This fixes a surprising number of compiler crashers. The reason this is an issue
at all is because we visit variables before their parent pattern binding decls.
(At least, that's one of the reasons...)

Swift SVN r30293
2015-07-17 00:22:24 +00:00
David Farler
241de1a1c3 Add popFirst/popLast implementations for some collections
Add the following non-customizable implementations:

- popFirst/popLast for Collections whose SubSequence == Self.
- Array.popLast
- ContiguousArray.popLast
- Set.popFirst
- Dictionary.popFirst

Swift SVN r30278
2015-07-16 22:52:05 +00:00
Dmitri Hrybenko
71c5bb9371 CoreMedia overlay: change CMTimeMakeWithSeconds into an initializer
Patch by Adam Sonnanstine.

rdar://20940262

Swift SVN r30271
2015-07-16 20:24:47 +00:00
Dmitri Hrybenko
e5e4335fad stdlib: Slice: trap on out-of-bounds indices
rdar://21822657

Swift SVN r30269
2015-07-16 18:22:40 +00:00
Dmitri Hrybenko
a41d7b7292 SDK overlay tests: disable a certain SceneKit test on non-OS X
Only OS X targets support COLLADA files.

rdar://20738811

Swift SVN r30265
2015-07-16 15:21:18 +00:00
David Farler
91b89b8956 Add SequenceType.forEach requirement and default implementation
rdar://problem/21663830

Swift SVN r30236
2015-07-15 23:36:23 +00:00
Dmitri Hrybenko
9d27519a69 SDK overlay: fix a bug in the SceneKit overlay and re-enable the test
Patch by Amaury Balliet.

Part of rdar://20738811

Swift SVN r30234
2015-07-15 23:29:09 +00:00
Doug Gregor
bb19420ab5 Add no-longer-recursing test from rdar://problem/21514140.
Swift SVN r30199
2015-07-14 21:18:59 +00:00
Doug Gregor
c52f920ad4 Fix an over-eager assertion.
Fixes rdar://problem/21382194; the deeper issue with this test case
was fixed recently, and only this assertion remained.

Swift SVN r30196
2015-07-14 21:17:07 +00:00
Dmitri Hrybenko
7ae303aeb3 Update Unicode data files to 8.0.0
rdar://19582621

Swift SVN r30141
2015-07-13 08:00:39 +00:00
Chris Lattner
cf14158405 When type checking an arbitrary subexpression of the current node, we can run
into trouble when we dive into a subexpr of a ClosureExpr, because that subexpr
may refer to type variables on the closureexpr's parameters.

Check for this case, and refuse to dive into the subexpr in this case.  It would
be great to rewrite the closure parameter types to Type() or ErrorType or something
so that we can proceed even in this case, but this causes us to fail to catch
nested constraint checking failures.

This was figured out while working on other things, but fixes a validation test.



Swift SVN r30135
2015-07-13 05:34:31 +00:00
Dmitri Hrybenko
4cfe818c43 StdlibUnittest: extract collection tests into a reusable generic testsuite
Swift SVN r30124
2015-07-12 01:04:38 +00:00
Chris Lattner
5b043a2e0a Fix <rdar://problem/21783334> compiler crashes on "{ x in x = 42"
which was the regression I introduced that broke "1616" out of the validation test.



Swift SVN r30123
2015-07-11 23:05:04 +00:00
Chris Lattner
63290f1f15 my diagnostics changes have provoked a preexisting CSGen crash regressing this test, move it until I can investigate.
Swift SVN r30119
2015-07-11 22:02:28 +00:00
Dmitri Hrybenko
1d38db56da StdlibUnittest: add {Minimal|Default}***MutableCollection types
Swift SVN r30115
2015-07-11 08:48:38 +00:00
Dmitri Hrybenko
b4ec45d625 stdlib: make Slice.init(base:bounds:) public
Swift SVN r30113
2015-07-11 05:58:06 +00:00
Dmitri Hrybenko
be5ef02bd0 Revert "stdlib: make Slice.init(base:bounds:) public"
This reverts commit 30111.  It broke the buildbots.

Swift SVN r30112
2015-07-11 05:34:05 +00:00
Dmitri Hrybenko
26ebe14178 stdlib: make Slice.init(base:bounds:) public
Swift SVN r30111
2015-07-11 05:20:41 +00:00
Dave Abrahams
9d07acd368 [stdlib] SequenceType's _initializeTo should return the end position
Otherwise, the length of the sequence is in principle lost.  If you know
you have a sequence of less than 100 elements, you still want to know
exactly how many elements you initialized from it.

Swift SVN r30104
2015-07-11 01:43:27 +00:00
Arnold Schwaighofer
ec686f2861 FixedPointDiagnostics.swift.gyb update expected error/note output
Swift SVN r30070
2015-07-10 15:01:19 +00:00
Arnold Schwaighofer
21ce6cdaa0 XFAIL while I update the expected diagnostic strings
No radar - I am working on updating now.

Swift SVN r30069
2015-07-10 14:34:57 +00:00
Chris Lattner
ceeb309e47 update validation test for diagnostics change. I still think that these are massive overkill...
Swift SVN r30063
2015-07-10 05:09:19 +00:00
Jordan Rose
bee5114781 Update validation-test/stdlib/Unicode.swift for DarwinBoolean.
rdar://problem/19013551

Swift SVN r30053
2015-07-10 01:39:10 +00:00
Dave Abrahams
68a86ca798 Clean up a test slightly.
Swift SVN r30023
2015-07-09 17:10:31 +00:00
Doug Gregor
03b1afce06 Don't revert the generic parameter list unless we're going to fill it in.
Fixes the crasher in rdar://problem/20000145 and 14 other compiler
crashers.

Swift SVN r29973
2015-07-08 13:13:17 +00:00
Doug Gregor
c410bce986 We cannot validate a declaration while its context is being type-checked.
Fixes rdar://problem/21538521 and a few crashers.

Swift SVN r29957
2015-07-08 04:21:51 +00:00
Dave Abrahams
ef198daa2b [stdlibunittest] Finish threading new trace facility through
Swift SVN r29955
2015-07-08 02:52:27 +00:00
Dave Abrahams
3179f78cbd Fix up stdlibunittest validation test
This should make the bot happier.

Swift SVN r29954
2015-07-08 01:34:30 +00:00
Dave Abrahams
ce93b0a9e0 [stdlibunittest] Still more de-boilerplating WIP
Swift SVN r29951
2015-07-08 00:28:33 +00:00
Doug Gregor
31787b66ee Generalize the "is being type checked" check to consider the type context.
Fixes 22 crashers.

Swift SVN r29948
2015-07-07 23:38:16 +00:00
Slava Pestov
9fb2080a94 Parser: Fix AST verifier failure with missing braces on struct and enum decls
Looks like classes were alrady doing the right thing.

Once again my fat fingers lead me to fix a compiler_crasher.

Swift SVN r29947
2015-07-07 21:44:59 +00:00
Slava Pestov
bb064da539 Sema: Fix AttributeChecker crash if getDeclaredTypeInContext() returns an ErrorType
Fixes <rdar://problem/21551616>.

Swift SVN r29943
2015-07-07 21:12:16 +00:00
Arnold Schwaighofer
8a06715357 Need Foundation for these tests
These tests don't work on linux.

rdar://21703386

Swift SVN r29940
2015-07-07 15:20:46 +00:00
Dave Abrahams
70ee2adc84 [stdlibunittest] More de-boilerplating WIP
Step 2.

Swift SVN r29936
2015-07-07 04:54:03 +00:00
Dave Abrahams
9abf32d521 [stdlibunittest] WIP uniformity/de-boilerplating
The way we pass and compose source locations, messages, etc. needs to be
brought under control before too many more tests get written.  This is
the first step.

Swift SVN r29928
2015-07-07 00:46:54 +00:00
David Farler
4d17bf0691 Remove SinkType and SinkOf
Remove these standard library types in favor of (T) -> () closures.

It was originally believed that generic optimizations would make these
types profitable, however:

// FIXME: Insert benchmarks here.

rdar://problem/21663799

Swift SVN r29927
2015-07-07 00:36:12 +00:00
Jordan Rose
20bfc1eaa2 [Serialization] If the output swiftmodule hasn't changed, don't touch the previous one.
Compiler output at least up to serialization should be deterministic at this point,
at least when not taking SIL into account. This /should/ mean that changing a
function body should not affect the final built swiftmodule, which means downstream
targets don't need to be rebuilt. Leaving the previous swiftmodule output in place
signals that.

A while back I put in a push to get all the non-determinism out of type checking,
importing, and serialization itself; it looks like we've finally made it. Let's keep
it that way!

rdar://problem/20539158 and others

Swift SVN r29923
2015-07-06 23:26:01 +00:00
Dmitri Hrybenko
4603431bd4 StdlibUnittest: implement more strict checks for using invalid indices
Add a shared buffer to every range replaceable mutable collection to
track logical mutations, and invalidate all indices on every mutation.

Swift SVN r29917
2015-07-06 16:12:03 +00:00
Chris Lattner
8637bb4c01 fix <rdar://problem/21679169> compiler crashes on "{(=_=_)in"
Swift SVN r29914
2015-07-06 04:46:56 +00:00
Slava Pestov
6992dfc5d1 AST: Start unifying UnqualifiedLookup and lookupVisibleDecl()
For now, just update NameLookup's FindLocalVal to use a
VisibleDeclConsumer just like lookupVisibleDecl().

A subsequent patch will continue removing duplicated code
now that this is place.

This fixes compiler crashers where we were not handling
declarations with duplicate names (which of course is an
error, diagnosed elsewhere).

Swift SVN r29913
2015-07-04 01:53:38 +00:00