Commit Graph

4289 Commits

Author SHA1 Message Date
Arnold Schwaighofer
a69c11978b Disable flaky type_checker_perf test on resilient bot
rdar://35779008
2017-11-30 12:37:11 -08:00
swift-ci
cefa6a5235 Merge pull request #13176 from aschwaighofer/xfail_resilient_stdlib_test 2017-11-30 09:13:28 -08:00
Ben Cohen
c4f0b5fe94 [stdlib] Adopt conditional conformance for Indices, Slice, ReversedCollection (#12913)
* Refactor Indices and Slice to use conditional conformance

* Replace ReversedRandomAccessCollection with a conditional extension

* Refactor some types into struct+extensions

* Revise Slice documentation

* Fix test cases for adoption of conditional conformances.

* [RangeReplaceableCollection] Eliminate unnecessary slicing subscript operator.

* Add -enable-experimental-conditional-conformances to test.

* Gruesome workaround for crasher in MutableSlice tests
2017-11-30 09:10:22 -08:00
Arnold Schwaighofer
a74e68fa39 Resilient stdlib: XFAIL RangeReplaceable.swift.gyb test
rdar://35646292
2017-11-30 08:21:26 -08:00
Pavel Yaskevich
49ca298f86 Merge pull request #13157 from xedin/fix-perf-test-rdar18360240
[TypeChecker] NFC: Increase exponential threshold for rdar://problem/18360240 test-case
2017-11-29 17:54:07 -08:00
Pavel Yaskevich
97cfcae4a0 [TypeChecker] NFC: Increase exponential threshold for rdar://problem/18360240 test-case 2017-11-29 15:26:02 -08:00
Kuba (Brecka) Mracek
3e87cf4bd1 Remove "%T" expansions (#11612) 2017-11-28 15:47:14 -08:00
swift-ci
36de380542 Merge pull request #13115 from xedin/rdar-35699666 2017-11-28 14:14:50 -08:00
Pavel Yaskevich
f5d9c2eb79 [Diagnostics] Fix crash related to diagnostics of trailing closures
While trying to diagnose a problem related to contextual result type
of the trailing closure, don't assume that declaration context is properly
set, instead directly set it to correct one before running type-check.

Resolves: rdar://problem/35699666
2017-11-28 13:12:25 -08:00
Nate Cook
04518afde3 [stdlib] Add conditional Hashable conformance for indices 2017-11-28 13:29:55 -06:00
Nate Cook
9dce40ca24 [stdlib] Add tests for index hashability 2017-11-28 13:29:55 -06:00
Ross Bayer
85abdcd62d Argparse "Overlay" Module (#12873)
* Implemented a wrapper module around the standard argparse package, exposing the same interface with some extras on top, including a new builder type with expressive DSL for constructing complex argument parsers.

* Fixed imports in build_swift/argparse/__init__.py to make flake8 happy.

* More re-formmating to meet the exacting standards of the python_lint script.

* Added doc-strings to all the modules in the build_swift argparse overlay.

* Implemented a new BoolType for the argparse module which handles boolean-like values and replaces the hard-coded boolean values in the _ToggleAction class.

* Fixed the mess of imports in the tests sub-package to favor relative imports, so now the unit-tests will actually run as expected. The README has also been updated with a better command for executing the unit-test suite.

* Updated the add_positional method on the ArgumentParser builder class to only take a single action or default to the store action.

* Cleaned up the set_defaults method.

* Added validation test to run the build_swift unit-tests.

* Updated validation-test for the build_swift unit-test suite to use %utils.

* Fixed hard-coded default values in the expected_options module used for generating argument parser tests.

* Updated the comment in the Python validation test to run the build_swift unit-tests.
2017-11-27 21:49:44 -08:00
swift-ci
d5b04e40b0 Merge pull request #13090 from aschwaighofer/disable_test_asan 2017-11-27 15:39:50 -08:00
swift-ci
36a08ec1bd Merge pull request #13087 from aschwaighofer/fix_stdlib_test_case_arraynew 2017-11-27 14:48:55 -08:00
Arnold Schwaighofer
66a2f5d05d Disable test that fails on linux asan bot
rdar://26498438
2017-11-27 14:35:06 -08:00
Arnold Schwaighofer
094091c8d7 stdlib: Fix UXPass in ArrayNew.swift.gyb
Michael recently fixed the original issue that the xfail was for.

rdar://35639581
2017-11-27 13:50:40 -08:00
Arnold Schwaighofer
48d11bd540 stdlib: Fix test cases Dictionary.swift and Set.swift
After the llvm inliner fix to correctly handle notail calls we don't need this
anymore.

rdar://35639547
2017-11-27 12:21:46 -08:00
Doug Gregor
9554e61705 [AST] Fix a crash when conformance lookup fails during substitution.
The enclosing conformance-lookup operation can fail (i.e., it returns
Optional), but the nested call was force-unwrapping the optional from
an inner call for no particular reason. Stop doing that, which fixes
SR-6466.

Note that the offending code is still something that should go away in
time, so this is merely polishing the band-aid to avoid a crash that
occurs often with conditional conformances.
2017-11-24 23:18:11 -08:00
Pavel Yaskevich
090acade11 [stdlib] Remove iterator type workaround from ClosedRange
After changes to stdlib and type-checker related to removing
of the `_Strideable` it's now possible to properly support
iterator types for *ClosedRange without any workarounds.

Resolves: rdar://problem/25584401
2017-11-23 18:51:35 -08:00
Doug Gregor
050fd9b0a4 Merge pull request #13032 from DougGregor/conditional-conformances-superclass
[AST] Properly adjust substitution type for inherited conformances.
2017-11-19 22:25:42 -08:00
Doug Gregor
41e0648336 [AST] Properly adjust substitution type for inherited conformances.
When we substitute into an inherited conformance, make sure that we
follow the superclass chain from the new conforming type up to the
matching superclass *before* doing the substitution.

Fixes rdar://problem/35632543.
2017-11-19 21:50:24 -08:00
Hamish
79d8209ffa [stdlib] Use addressor for Dictionary's subscript(_:default:) 2017-11-19 15:45:27 +00:00
swift-ci
53ddcb5079 Merge pull request #13000 from gottesmm/pr-6a0399e1ebd7ccad1979a2af165d0b09595fb2cb 2017-11-18 20:55:27 -08:00
Michael Gottesman
89cefe0a70 [stdlib] Use a different access pattern to check uniqueness to work around more conservative SILGen codegen.
Using && here causes us to go down a SILGen path that guarantees that self will
be evaluated over the entire && expression instead of just the LHS. This cause
the uniqueness check to always return false at -Onone. At -O, the optimizer is
smart enough to remove this issue.

rdar://33358110
2017-11-18 20:16:28 -07:00
ematejska
a00b0749c4 Merge pull request #12849 from rudkx/SE-0054
SE-0054: Rework diagnostics for IUOs and revise Swift 3 /4 semantics.
2017-11-18 18:51:39 -08:00
taylor swift
c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Doug Gregor
9f1cd0bf6b [Stdlib] Move _OptionalNilComparisonType operators into an extension on Optional.
Because global operators are “meh”.
2017-11-17 20:41:43 -08:00
Mark Lacey
8b55a0f61b SE-0054: Rework diagnostics for IUOs and revise Swift 3 /4 semantics.
For Swift 3 / 4:

Deprecate the spelling "ImplicitlyUnwrappedOptional", emitting a warning
and suggesting "!" in places where they are allowed according to
SE-0054.

In places where SE-0054 disallowed IUOs but we continued to accept them
in previous compilers, emit a warning suggesting "Optional" or "?"  as
an alternative depending on context and treat the IUO as an Optional,
noting this in the diagnostic.

For Swift 5:

Treat "ImplicitlyUnwrappedOptional" as an error, suggesting
"!" in places where they are allowed by SE-0054.

In places where SE-0054 disallowed IUOs, emit an error suggestion
"Optional" or "?" as an alternative depending on context.
2017-11-18 11:41:53 +09:00
Pavel Yaskevich
b56786fc03 Merge pull request #12986 from xedin/rdar-35540159
[CSSolver] Prune disjunction choices based on their equivalence class
2017-11-17 13:05:04 -08:00
eeckstein
73fc4b221b Merge pull request #12976 from eeckstein/remove-semantic
Remove @_semantics("optimize.sil.never")
2017-11-17 07:54:31 -08:00
Doug Gregor
7ec8512b11 Merge pull request #12970 from DougGregor/conformance-interface-type
[AST] Store only interface types in NormalProtocolConformances.
2017-11-17 07:52:59 -08:00
Pavel Yaskevich
b16add7685 [CSSolver] Prune disjunction choices based on their equivalence class
There are situations where we know equivalence relationship between
multiple disjunctions, let's prune dependent choice space based on
choice picked for the parent disjunction.

Resolves: rdar://problem/35540159
2017-11-16 19:35:14 -08:00
Pavel Yaskevich
57ccdf7423 Merge pull request #12520 from xedin/remove-strideable
[stdlib] changes to remove `_Strideable` protocol.
2017-11-16 19:06:40 -08:00
Erik Eckstein
76f281510f Remove @_semantics("optimize.sil.never")
The replacement is @_optimize(none)
2017-11-16 14:11:52 -08:00
Pavel Yaskevich
7b121de1a0 [CSRanking] Change ranking to weight overload choices in evaluation order
Consider different overload choices for the same location in evaluation
order, this makes overload resolution more predictable because it's going
to follow expression bottom-up, that prevents situations when some
expressions are considered ambigious because choices taken further up
equate the score, instead each level is given distinct weight
based on evaluation order.

Resolves: rdar://problem/31888810
2017-11-16 13:38:24 -08:00
Doug Gregor
a8cd86f811 Add no-longer-crashing test case from rdar://problem/35441779. 2017-11-16 11:36:52 -08:00
Arnold Schwaighofer
ce2966dd6e Merge pull request #12957 from aschwaighofer/callee_guaranteed_closures
SILGen: Remaining fixes for @callee_guaranteed closures and enable it
2017-11-16 11:12:54 -08:00
Slava Pestov
3f51dbc3b1 Sema: Don't validate types when binding extensions 2017-11-15 21:55:55 -08:00
Arnold Schwaighofer
0971d82f70 SILGen: Remaining fixes for @callee_guaranteed closures and enable it
- Fix block to func reabstraction thunks block argument handling
- Forward cast ownership
- Fix applyPartiallyAppliedSuperMethod ownership for @callee_guaranteed closures
- Avoid a copy in buildBlockToFuncThunkBody
- Update tests for callee_guaranteed closures

SR-5441
rdar://33255593
2017-11-15 19:46:08 -08:00
Slava Pestov
4096000530 Merge pull request #12942 from slavapestov/lazy-protocol-member-validation
Lazy protocol member validation
2017-11-15 18:03:40 -08:00
Slava Pestov
772bd7634c Sema: Lazily validate protocol members 2017-11-15 16:26:27 -08:00
Greg Parker
e8475cc130 Revert "Use conditional conformances to implement Equatable for Optional, Array and Dictionary" 2017-11-15 14:17:22 -08:00
Slava Pestov
eea544f4e5 Merge pull request #12931 from slavapestov/you-do-not-require-asserts-unless-you-crash
Fixed crashers don't require asserts
2017-11-14 21:45:54 -08:00
Doug Gregor
4cc3447de8 Fix a test due to Equatable Optional/Array/Dictionary change. 2017-11-14 16:23:20 -08:00
Slava Pestov
afd9903509 Fixed crashers don't require asserts 2017-11-14 12:19:09 -08:00
Slava Pestov
b6200728a6 Sema: Fix crash on invalid openUnboundGenericType()
We can't construct a nominal type with an ErrorType as a
parent, so in the bad circular case, return a Type() instead
to bail out of transform() altogether.
2017-11-14 00:07:56 -08:00
Slava Pestov
fb2a6d2025 SILOptimizer: Fix convert_function -> apply peephole for metatype conversions
Fixes <rdar://problem/35492775>.
2017-11-13 22:10:14 -08:00
Arnold Schwaighofer
76f538a684 Disable test_superclass_methods.swift and test_superclass_properties.swift
rdar://35492775
2017-11-12 06:24:12 -08:00
Arnold Schwaighofer
be114b156d Merge pull request #12883 from aschwaighofer/disable_modelio_test_ios
Disable ModelIO test on ios
2017-11-11 20:39:57 -08:00
Arnold Schwaighofer
4aecd0d74f Also fails on appletvos 2017-11-11 18:52:20 -08:00