Commit Graph

120 Commits

Author SHA1 Message Date
Dmitri Hrybenko
58601fafc8 Remove Array.count, it is redundant with protocol extensions
Swift SVN r28247
2015-05-07 00:30:41 +00:00
Dmitri Hrybenko
c109ec9125 stdlib: protocol extensions: de-underscore count()
Swift SVN r28246
2015-05-07 00:30:38 +00:00
Dmitri Hrybenko
275cfc0545 stdlib: protocol extensions: de-underscore underestimateCount()
Swift SVN r28240
2015-05-07 00:30:28 +00:00
Dmitri Hrybenko
035d72d5a7 stdlib: protocol extensions: de-underscore contains()
Swift SVN r28236
2015-05-07 00:30:24 +00:00
Dave Abrahams
5741bdc355 [stdlib] Prototyping progress for new Option Sets
Swift SVN r28161
2015-05-05 07:44:33 +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
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +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
Doug Gregor
126e404fe5 Reimplement inference of type witnesses with a separate non-recursive pass.
Inference of type witnesses for associated types was previously
implemented as part of value witness matching in the constraint
solver. This led to a number of serious problems, including:
  - Recursion problems with the solver hunting for a type witness,
  which triggers more attemts to match value witnesses...
  - Arbitrarily crummy attempts to break the recursion causing
  type-check failures in fun places.
  - Ordering dependencies abound: different results depending on which
  value witnesses were satisfied first, failures because of the order
  in which we attempted to infer type witnesses, etc.

This new implementation of type witness inference uses a separate pass
that occurs whenever we're looking for any type witness, and solves
all of the type witnesses within a given conformance
simultaneously. We still look at potential value witnesses to infer
type witnesses, but we match them structurally, without invoking the
constraint solver.

There are a few caveats to this implementation:
  * We're not currently able to infer type witnesses from value
  witnesses that are global operators, so some tricks involving global
  operators (*cough* ~> *cough*) might require some manually-specified
  type witnesses. Note that the standard library doesn't include any
  such cases.

  * Yes, it's another kind of solver. At simple one, fortunately.

On the other hand, this implementation should be a big step forward:
  * It's far more predictable, order-invariant, and non-recursive.
  * The diagnostics for failures to infer type witnesses have
  improved.

Fixes rdar://problem/20598513.

Swift SVN r27616
2015-04-23 00:20:05 +00:00
Joe Groff
da83f7c59d Un-XFAIL test/Prototypes/MutableIndexableDict.swift on linux.
Swift SVN r27548
2015-04-22 00:45:18 +00:00
Dave Abrahams
266abbded1 [stdlib] Prototype IndexingGenerator deduction
Had to disable Sequence.Element deduction hack for this to work

Swift SVN r27435
2015-04-17 17:39:07 +00:00
Dave Abrahams
c6095cfdd0 [stdlib] Prototype ConcreteGeneratorType
An easy way to make every GeneratorType be a SequenceType (in practice)

Swift SVN r27434
2015-04-17 17:39:06 +00:00
Dave Abrahams
10aa403583 [stdlib] Make IndexingGenerator work in prototype
Next up: get it to be deduced and defaulted

Swift SVN r27433
2015-04-17 17:39:06 +00:00
Dave Abrahams
c206504d17 [stdlib] Prototype sequence dispatch sans ~>
Just a rough beginning but it passes type checking.

Also demonstrates simulated typealias in protocol extension hack (the
actual feature isn't yet supported).

Swift SVN r27309
2015-04-15 04:03:12 +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
Dave Abrahams
4a1cd41f51 [stdlib] Prototype library-only OptionSet type
Swift SVN r27054
2015-04-07 02:45:54 +00:00
Dave Abrahams
50c6e936d4 [stdlib] NewMirrors => SwiftExperimental
Swift SVN r26359
2015-03-20 18:17:55 +00:00
Dave Abrahams
6b7f566b8a [stdlib] NewMirrors: remove MirrorPathType
it wasn't serving any useful purpose

Swift SVN r26358
2015-03-20 17:56:14 +00:00
Dave Abrahams
4d7bc24de3 [stdlib] NewMirrors: rename "address"=>"descendant"
Swift SVN r26357
2015-03-20 17:56:13 +00:00
Dave Abrahams
51a6aa1dae [stdlib] NewMirrors: legacy mirror adaptor, addressing
Swift SVN r26349
2015-03-20 06:56:30 +00:00
Dave Abrahams
a47659339f [stdlib] NewMirrors: use ExistentialCollection
We now present an interface for traversing children consistent with the
rest of the standard library's design.

Swift SVN r26336
2015-03-19 23:51:47 +00:00
Dave Abrahams
2b34e13aef [stdlib] Delete mistakenly-committed file
Swift SVN r26316
2015-03-19 20:54:55 +00:00
Dave Abrahams
dedbc72aed [stdlib] ExistentialCollection => SwiftExperimental
This sets us up to use it in the mirrors prototype.
TODO: doc comments

Swift SVN r26314
2015-03-19 20:53:25 +00:00
Dave Abrahams
1862587a2a [stdlib] ExistentialCollection: random access
Swift SVN r26307
2015-03-19 18:32:13 +00:00
Dave Abrahams
01802eed33 [stdlib] ExistentialCollection: Up/downgrades
More-capable collections can be converted to less-capable.
Failable conversions are available in the opposite direction

Swift SVN r26306
2015-03-19 18:32:12 +00:00
Dave Abrahams
67e4e1854e [stdlib] ExistentialCollection: AnyXXXCollection
Swift SVN r26305
2015-03-19 18:32:11 +00:00
Dave Abrahams
46db6e0f0a [stdlib] ExistentialCollection: 80 columns
Swift SVN r26304
2015-03-19 18:32:11 +00:00
Dave Abrahams
7f89ae5042 [stdlib] ExistentialCollection: Sequence
Swift SVN r26303
2015-03-19 18:32:10 +00:00
Dave Abrahams
8d4f884d9c [stdlib] ExistentialCollection: naming
Swift SVN r26302
2015-03-19 18:32:03 +00:00
Dave Abrahams
da39cef8f1 [stdlib] ExistentialCollection: use -> Self where possible
<rdar://20181253> prevents using it everywhere we should, but it's a start

Swift SVN r26211
2015-03-17 00:55:27 +00:00
Dave Abrahams
36ae934988 [stdlib] ExistentialCollection: comments
Swift SVN r26210
2015-03-17 00:55:26 +00:00
Dave Abrahams
d8825200f7 [stdlib] ExistentialCollection: Bidirectional
Swift SVN r26209
2015-03-17 00:55:26 +00:00
Dave Abrahams
fbe5a61a2a [stdlib] ExistentialCollection: rearrange
Swift SVN r26208
2015-03-17 00:55:25 +00:00
Dave Abrahams
97f6275c75 [stdlib] ExistentialCollection: ObjectIdentifier as type ID
Swift SVN r26187
2015-03-16 19:23:42 +00:00
Dave Abrahams
bf7b379587 [stdlib] ExistentialCollection: still more naming
Swift SVN r26156
2015-03-15 16:32:25 +00:00
Dave Abrahams
4517685cea [stdlib] ExistentialCollection: remove a hack
Swift SVN r26155
2015-03-15 16:32:24 +00:00
Dave Abrahams
25654731ae [stdlib] ExistentialCollection: use protocols for abstract interfaces
Swift SVN r26154
2015-03-15 16:32:23 +00:00
Dave Abrahams
38106c9b89 [stdlib] ExistentialCollection: naming and indentation
Swift SVN r26153
2015-03-15 16:32:22 +00:00
Dave Abrahams
9909c887f2 [stdlib] re-commit ExistentialCollection Prototype
This time, with horrible no good very bad workarounds for
<rdar://20164041>

Swift SVN r26141
2015-03-14 19:20:27 +00:00
Dave Abrahams
ee34008815 [stdlib] NewMirrors: reapply naming tweaks
Swift SVN r26139
2015-03-14 16:52:50 +00:00
Erik Eckstein
d1bdc956af Revert "[stdlib] Start ExistentialCollection Prototype"
The test does not compile.



Swift SVN r26138
2015-03-14 13:25:34 +00:00
Erik Eckstein
4174a9aafd Revert "[stdlib] NewMirrors: naming tweaks"
Resulted in compile errors in NewMirrors.swift



Swift SVN r26137
2015-03-14 13:04:47 +00:00
Dave Abrahams
2d75a5d37a [stdlib] Start ExistentialCollection Prototype
New mirrors will present their children as a
ForwardCollection<ReflectedChild>.

Swift SVN r26131
2015-03-14 06:32:46 +00:00
Dave Abrahams
9befe882c2 [stdlib] NewMirrors: naming tweaks
Swift SVN r26130
2015-03-14 06:32:45 +00:00
Dave Abrahams
853cc6a7b3 [stdlib] Clean up generic dispatching prototype...
...by removing the underscored protocols, thereby confirming Dmitri's
assertion that this technique is no longer needed, and we can clean some
of these protocols out of the standard library!

In the cases where they're used to get around the lack of recursive
protocol requirements, though, they must remain.

Swift SVN r26047
2015-03-12 13:08:18 +00:00
Dave Abrahams
f5e982ca22 [stdlib] Mirror prototype: some renaming
Swift SVN r26018
2015-03-12 01:01:34 +00:00
Dave Abrahams
96700511e4 [stdlib] Fix minor comment typo
Swift SVN r26017
2015-03-12 01:01:33 +00:00
Dave Abrahams
dd26a7ea36 [stdlib] Add initial prototype for new mirrors
still todo:

* Create mirrors instead of Any's for individual children
* Bulking API
* Bikeshedding everything, including names

Swift SVN r26014
2015-03-12 00:55:17 +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
David Farler
87c3d7421f Refine static func and var syntax
rdar://problem/17198298

- Allow 'static' in protocol property and func requirements, but not 'class'.
- Allow 'static' methods in classes - they are 'class final'.
- Only allow 'class' methods in classes (or extensions of classes)
- Remove now unneeded diagnostics related to finding 'static' in previously banned places.
- Update relevant diagnostics to make the new rules clear.

Swift SVN r24260
2015-01-08 03:03:29 +00:00