Commit Graph

3633 Commits

Author SHA1 Message Date
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
Slava Pestov
b03a77f13c Sema: Fix some compiler crashes related to ErrorType handling
- NominalTypeDecl::computeInterfaceType() crash when parent decl
  has error type
- createMaterializeForSetPrototype() crash when parent decl
  has error type
- Crashes in ConformanceChecker when decl has error type

Fixes <rdar://problem/21583601>.

Swift SVN r29912
2015-07-04 01:53:36 +00:00
Chris Lattner
59527f0a0b Fix for 21643437. Because of weirdness in this test (tracked by 19434979), the diagnostics on these lines are
different on iOS and the Mac, so just relax the checks back to the way they were.


Swift SVN r29899
2015-07-02 21:15:28 +00:00
Doug Gregor
880ad409db Pick the potential archetype we use for the actual archetype more intelligently.
Archetypes either need to be a root, which corresponds to a type
parameter, or need to be parented by another archetype. When the
representative of an equivalence class of potential archetypes has a
parent, but that parent has been made equivalent to some concrete type
via a same-type constraint, choose a different potential archetype as
the "anchor", i.e., one that has no concrete types in its parent
chain. Fixes rdar://problem/21625478 and the canonical example in
rdar://problem/17619740.

Swift SVN r29898
2015-07-02 20:57:37 +00:00
Dmitri Hrybenko
1edcc49ff9 stdlib: remove Slice.Element typealias
It is misleading in generic code.  A testcase that was failing:

  expectEqualType(C.Generator.Element.self, Slice<C>.Element.self)

Swift SVN r29887
2015-07-02 06:44:38 +00:00
Dmitri Hrybenko
d16c27886a stdlib tests: Doug fixed the blocking bugs, so we can simplify tests
Swift SVN r29886
2015-07-02 05:24:46 +00:00
Doug Gregor
9f66a12a9c Add test from rdar://problem/21333511 that no longer crashes.
Swift SVN r29883
2015-07-02 04:53:10 +00:00
Doug Gregor
2038a8e837 Handle nested types of concrete types in the constraint solver.
... I have no idea why we were foolishly mapping such things to their
parent type, which made no sense whatsoever. Fixes
rdar://problem/21621421.

Swift SVN r29882
2015-07-02 04:45:15 +00:00
Chris Lattner
24eee303dc update for diagnostic change. Remove -verify, validation tests should not be checking diagnostics.
Swift SVN r29880
2015-07-02 03:25:12 +00:00
Doug Gregor
4ce98a2b0d Fix RUN line; this isn't passing
Swift SVN r29871
2015-07-02 00:11:23 +00:00
Doug Gregor
9479679e4e Add test from rdar://problem/21621421.
Swift SVN r29870
2015-07-02 00:08:27 +00:00
Doug Gregor
87b4eeccf3 Make same-type requirements prefer to be rooted at outer generic parameters.
All archetypes from outer scopes are fixed (as a lame implementation
restriction), so same-type constraints that involve archetypes from
outer scopres should treat the archetypes from outer scopes as the
representative. Do so, and start eliminating the notion of a "primary"
archetype that was preventing this fix from occurring earlier, so that
"all archetypes" and the set of requirements generated from the
archetype builder still line up.

Fixes rdar://problem/19519590.

Swift SVN r29869
2015-07-02 00:08:24 +00:00
Andrew Trick
59b6dff24e Temporarily disableFixedPointDiagnostics test on iOS.
<rdar://problem/21643437> FixedPointDiagnostics regression on iOS

Swift SVN r29865
2015-07-01 23:52:30 +00:00
David Farler
438119d558 Fold ExtensibleCollectionType into RangeRaplaceableCollectionType
ExtensibleCollectionType's operations can all be represented by the
primitive range replacement operation, so fold it into
RangeReplaceableCollectionType.

In addition, provide default implementations of
RangeReplaceableCollectionType's methods.

- New tests added for combinations of (static, generic) calls and
  (default, custom) implementations.
- Mark free Swift functions as unavailable with a message to direct the
  developer to the protocol methods.
- Mark ExtensibleCollectionType as available with a message added to
  direct the developer to the right protocol.

rdar://problem/18220295

Swift SVN r29857
2015-07-01 22:33:04 +00:00
Dmitri Hrybenko
fc0fa96371 stdlib: de-underscore Indexable and add tests for it
Swift SVN r29847
2015-07-01 18:31:31 +00:00
Dmitri Hrybenko
76f5706b50 stdlib: de-underscore the Slice type and add tests for it
Swift SVN r29846
2015-07-01 18:31:29 +00:00
Dmitri Hrybenko
80b1380fe8 stdlib: fold Sliceable into CollectionType and de-underscore SubSequence
Swift SVN r29845
2015-07-01 18:31:25 +00:00
Chris Lattner
762cb3fa62 start loosening up getTypeOfIndependentSubExpression() to walk into more kinds of
expressions.  Broadening from callexpr to apply expr (picking up operators) improves
several diagnostics in the testsuite, and is important to avoid regressions from an 
upcoming patch.


Swift SVN r29821
2015-06-30 23:25:47 +00:00
Chris Lattner
77fce6b76c update notes to go with r29810
Swift SVN r29820
2015-06-30 23:20:24 +00:00
Doug Gregor
a8b7ff86cd Add test case for rdar://problem/21598514.
Swift SVN r29811
2015-06-30 21:51:09 +00:00
Doug Gregor
8f31e03ebd Completely check the requirements of a protocol as part of validation.
We were doing piecemeal checking of the requirements of specific
associated type bindings, but such checking is incomplete: superclass
constraints and, although currently inexpressible, same-type
constraints are not validated by these early checks, so this is more
correct and more robust.

Swift SVN r29808
2015-06-30 21:11:20 +00:00
Doug Gregor
7ee8b36993 Be more defensive when looking up associated types.
The attempted invariants were too strong for ill-formed code. Fixes
rdar://problem/21511651.

Swift SVN r29801
2015-06-30 05:14:04 +00:00
Doug Gregor
8a26662368 Use the generic signature to check specialized uses of generic types.
Previously, we were simply walking over the requirements of each of
the associated types, which meant that we weren't considering
same-type constraints. Also cleans up the diagnostics a little bit and
eliminates some extra computation whose results were getting thrown
away.

Swift SVN r29793
2015-06-29 22:06:19 +00:00
Dave Abrahams
4b4510e79a [stdlib] Simplifying filter tests (WIP)
Swift SVN r29790
2015-06-29 20:45:51 +00:00
Dave Abrahams
8c855e1ecf [stdlibunittest] automatic LifetimeTracked checking/setup
In setup and teardown, we can initialize and check for leaks

Swift SVN r29789
2015-06-29 20:45:50 +00:00
Dave Abrahams
7aed41190f [stdlibunittest] Automatically reset common test environment
Swift SVN r29787
2015-06-29 20:45:48 +00:00
Dave Abrahams
a35204ca55 [stdlibunittest] logging sequence/generator wrappers
Swift SVN r29786
2015-06-29 20:45:46 +00:00