Commit Graph

3245 Commits

Author SHA1 Message Date
Max Moiseev
d71c73bbba Fixing stdlib tests 2017-01-06 18:08:36 -08:00
Max Moiseev
6a06b667da Fixing some and XFAILing other failing tests 2017-01-06 17:56:20 -08:00
Ben Cohen
3bdada1773 Merge pull request #6506 from airspeedswift/im-not-warning-you-again
[stdlib] Squash various warnings
2017-01-06 16:51:06 -08:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
Philippe Hausler
45714e6263 [Foundation] Correct sequence initializers for Data when repeating:count: is called and add a memset fast-path 2017-01-06 13:56:08 -08:00
Robin Kunde
f7c8a9245b SR-3378: Replace deprecated methods addingPercentEscapes(using:) and replacingPercentEscapes(using:) in test/stdlib/NSStringAPI.swift (#6167)
Resolves SR-3378.
2017-01-06 13:43:10 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Ben Cohen
ca6353d60e Update raw version to return a typed buffer 2017-01-05 11:59:50 -08:00
Ben Cohen
d12beac355 Add UnsafeRawBufferPointer.initialize(as:from:) 2017-01-05 11:59:49 -08:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
ben-cohen
ce0d713cd6 fixed where clauses, Optional-as-Any and unused vars 2016-12-29 07:58:12 -08:00
Philippe Hausler
b57752a67f [Foundation] Correct case of over-released data contents when specifying .none as a deallocator 2016-12-19 14:37:24 -08:00
Joe Groff
2e0cb9c0a2 Runtime: getDynamicType can't drill into existentials when producing a concrete metatype.
For a value of an opaque generic type `<T> x: T`, the language currently defines `type(of: x)` and `T.self` as both producing a type `T.Type`, and the result of substituting an existential type by `T == P` gives `P.Protocol`, so the `type(of:)` operation on `x` can only give the concrete protocol metatype when `x` is an existential in this case. The optimizer understood this rule, but the runtime did not, causing SR-3304.
2016-12-19 11:03:52 -08:00
Max Moiseev
ea8f2209a3 Overflow checks in division/modulo operators + tests 2016-12-15 16:32:07 -08:00
Max Moiseev
94564ebc37 Adding some doubleWidthMultiply and bouldWidthDivide tests 2016-12-15 13:42:47 -08:00
Max Moiseev
265060df84 Adding integer unit tests from the original prototype 2016-12-14 17:16:56 -08:00
Max Moiseev
5fb929cabf Merge branch 'master' into new-integer-protocols 2016-12-09 10:51:48 -08:00
Greg Parker
df7ad7cb12 [test] Temporarily disable String.completePath() test. 2016-12-09 02:19:47 -08:00
Hooman Mehr
d7d05e1a92 Make .significandWidth do the right thing for exact powers of two
Resolves SR-2868.
2016-12-08 14:49:19 -05:00
Max Moiseev
356c15cb4a Merge remote-tracking branch 'origin/master' into new-integer-protocols 2016-12-06 10:35:27 -08:00
Slava Pestov
a5c5a0103a Sema: Don't look at SubstitutedType in CSDiag
The code here is unprincipled, and mixes archetypes from
multiple sources:

1) The callee's generic environment

2) The caller's generic environment

3) Any random archetypes appearing in the original types of
   typealiases, which could come from any generic environment

Initially, an UncurriedCandidate's type starts out as #1,
and then we sometimes set it to type #2 if the candidate is
a method on a base class.

We get #3 by virtue of walking the original types of
SubstitutedTypes created as part of dependent member type
substitution.

However, it turns out the real reason the SubstitutedType
walk existed was so that #2 archetypes that appear in the
UncurriedCandidate's type map to themselves. This doesn't
require looking at the original type of a SubstitutedType
at all; instead we just walk the UncurriedCandidate's type
normally, collecting archetypes.

If we do this, the code doesn't (erroneously) pick up random
archetypes from typealiases, and this changes the output in
the RangeDiagnostics test. While we can debate if the new
diagnostics are better or worse (I think it's either a wash,
or slightly better) the reason they changed is because more
in-depth diagnostic code is now executing, without breaking
things randomly as before. I suspect this is a good thing.
2016-12-05 13:22:23 -08:00
Max Moiseev
baf392eda4 Deprecating the BitwiseOperations protocol in favor of FixedWidthInteger 2016-12-02 16:59:32 -08:00
Max Moiseev
fa8adad85d Not using arithmetic operators on strideables in test 2016-12-02 15:39:35 -08:00
Doug Gregor
c98295357c [Archetype builder] Simplify handling of typealiases in protocols.
PotentialArchetype::getNestedType() was effectively reimplementing a
simplified form of mapTypeOutOfContext(), missing some cases in the
process. Just use mapTypeOutOfContext() and resolveArchetype(). While
here, stop re-implementing the addSameType* operations; just call them
directly. With these changes, we no longer need the "typealias in
protocol is too complex" diagnostic.

Eliminates another use of getSelfTypeInContext().
2016-12-02 15:31:04 -08:00
Philippe Hausler
4c2d6e24ff Merge pull request #5975 from phausler/data_performance
First draft at a new inlinable version of struct Data
2016-12-02 10:44:51 -08:00
Jordan Rose
e54ec3d2d4 Merge pull request #5854 from jrose-apple/excise-silgen_name-from-Dispatch
Use an extra shims header to remove _silgen_name from Dispatch.
2016-12-02 09:20:24 -08:00
Greg Parker
5001ee4645 Revert "Test and Fix: subset and superset for empty character set" (#6021) 2016-12-01 20:26:10 -08:00
Jordan Rose
1c68744341 [test] Let test output go to stdout.
...so we can see it in failure logs.
2016-12-01 16:06:15 -08:00
MuhammadAnnaqeeb
e41a29a11c Fix subset and superset for empty character set (#6000)
Fix isSubset() and isSuperset() involving the empty CharacterSet.
2016-12-01 14:43:25 -08:00
Slava Pestov
c71395a4c3 Sema: Small cleanup in CSDiag 2016-12-01 13:00:17 -08:00
Philippe Hausler
bdafb2dac0 Handle no-copy cases and custom deallocators as inline construction of swift Data 2016-12-01 12:27:57 -08:00
Philippe Hausler
9c0951b5b2 First draft at a new inlinable version of struct Data 2016-11-29 10:53:44 -08:00
Max Moiseev
70b2343626 Merge branch 'master' into new-integer-protocols 2016-11-28 15:25:01 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Rintaro Ishizaki
9e5c8ee4a0 [Tests] Add testcase for type printing. 2016-11-24 10:46:36 +09:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Max Moiseev
97981907e1 Merge branch 'master' into new-integer-protocols 2016-11-18 09:36:02 -08:00
Ben Cohen
3016d5e960 Merge pull request #5845 from airspeedswift/replace-as-with-is
Replace (x as? Y) != nil with x is Y
2016-11-18 09:31:38 -08:00
Slava Pestov
e2be8e2fc8 stdlib: Add swift_getTypeName() tests for nested generics 2016-11-18 00:39:15 -08:00
Slava Pestov
4e4d281aa7 stdlib: Rework swift_typeName() to use _swift_buildDemanglingForMetadata()
Previously we had two separate mechanisms to turn a metatype
into a string. The swift_typeName() function was used to print
the metatype in a human-readable fashion, whereas the
_swift_buildDemanglingForMetadata() was used when naming
generated generic Objective-C classes.

Unify them, since what swift_typeName() does is redundant;
instead of going directly from the metatype to a human-readable
string, we can get the mangling, and print that using the
demangler.

This fixes some issues with unnecessary parenthesis when
printing function types, and also allows Objective-C classes
to be instantiated with nested generic types as parameters.
2016-11-18 00:39:14 -08:00
Ben Cohen
05b63ebffb Replace (x as? Y) != nil with x is Y 2016-11-17 11:26:36 -08:00
Max Moiseev
92813be403 Merge branch 'master' into new-integer-protocols 2016-11-11 16:14:57 -08:00
Tony Parker
8f8f6fd5f3 Fix AffineTransform initializer 2016-11-07 14:02:08 -08:00
Alexis Beingessner
c565c7ca02 Merge pull request #5291 from Gankro/dsindex
[stdlib] Rewriting native hashed collection indices
2016-11-04 11:21:57 -04:00
Alexis Beingessner
7ec26fc976 fallout of renaming on tests which rely on internals
Some of these are kinda dubious, but I think this would be better
addressed as part of eager bridging, which will invalidate the concept
most of these are checking for.
2016-11-03 19:55:36 -04:00
Alexis Beingessner
052e94a34a refactor HashedCollections to support verbatim bridging 2016-11-03 19:52:30 -04:00
Alexis Beingessner
b7e200ef99 properly expose == to objc in test
This test was relying on an impl detail that was never guaranteed and
no longer holds (multiple bridgings of a dict had equal identity). Based
on how the code in the test is written, it appears to be an accident.
This change makes the test "make sense" without the impl detail.
2016-11-03 19:52:30 -04:00
Janek Spaderna
d5e1819416 [stdlib] Don't try to construct invalid UnicodeScalars
When inserting a closed range/creating a CharacterSet from a closed
range we must not try to convert this range to a half open one by
incrementing the upperBound UnicodeScalar because not all integer values
are valid values for UnicodeScalar

Fixes SR-2988
2016-11-02 12:20:31 +01:00
Max Moiseev
76e0a99a37 Merge branch 'master' into new-integer-protocols 2016-10-31 09:29:19 -07:00
practicalswift
2024316e38 [gardening] Remove accidental trailing whitespace (" " and "\t") 2016-10-30 10:59:02 +01:00