Commit Graph

2426 Commits

Author SHA1 Message Date
swift-ci
dcc3937689 Merge remote-tracking branch 'origin/master' into master-next 2018-07-07 07:39:56 -07:00
Slava Pestov
19de53f6cf Sema: Remove dead code from access level computation rework 2018-07-06 23:50:36 -07:00
swift-ci
0b12c9a5fa Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 00:49:00 -07:00
Slava Pestov
9f055beb55 Merge pull request #17783 from slavapestov/kill-lvalue-access-kind
Kill lvalue access kind
2018-07-06 00:39:26 -07:00
Slava Pestov
70732015f3 IDE: Stop using Expr::getLValueAccessKind() 2018-07-05 23:49:57 -07:00
Slava Pestov
03f1e13a50 IDE: Index references from keypaths 2018-07-05 23:33:59 -07:00
swift-ci
a93ce92de1 Merge remote-tracking branch 'origin/master' into master-next 2018-07-02 20:29:09 -07:00
Doug Gregor
793ba723f7 [AST] Delete the unused FileUnitKind::Derived.
The last use of this went away a loooooong time ago. NFC.
2018-07-02 13:32:39 -07:00
swift-ci
f3b8a3cbaf Merge remote-tracking branch 'origin/master' into master-next 2018-06-30 10:09:20 -07:00
John McCall
f81036202d Merge pull request #17566 from rjmccall/storage-impls
Generalize storage implementations to support generalized accessors
2018-06-30 12:58:33 -04:00
swift-ci
3026500f59 Merge remote-tracking branch 'origin/master' into master-next 2018-06-30 06:29:07 -07:00
John McCall
9bee3cac5a Generalize storage implementations to support generalized accessors.
The storage kind has been replaced with three separate "impl kinds",
one for each of the basic access kinds (read, write, and read/write).
This makes it far easier to mix-and-match implementations of different
accessors, as well as subtleties like implementing both a setter
and an independent read/write operation.

AccessStrategy has become a bit more explicit about how exactly the
access should be implemented.  For example, the accessor-based kinds
now carry the exact accessor intended to be used.  Also, I've shifted
responsibilities slightly between AccessStrategy and AccessSemantics
so that AccessSemantics::Ordinary can be used except in the sorts of
semantic-bypasses that accessor synthesis wants.  This requires
knowing the correct DC of the access when computing the access strategy;
the upshot is that SILGenFunction now needs a DC.

Accessor synthesis has been reworked so that only the declarations are
built immediately; body synthesis can be safely delayed out of the main
decl-checking path.  This caused a large number of ramifications,
especially for lazy properties, and greatly inflated the size of this
patch.  That is... really regrettable.  The impetus for changing this
was necessity: I needed to rework accessor synthesis to end its reliance
on distinctions like Stored vs. StoredWithTrivialAccessors, and those
fixes were exposing serious re-entrancy problems, and fixing that... well.
Breaking the fixes apart at this point would be a serious endeavor.
2018-06-30 05:19:03 -04:00
Slava Pestov
1d2d653844 IDE: Redo typeCheckContext()
- Don't type check top-level contexts multiple times
- Use validateDecl() instead of typeCheckDecl() when possible
2018-06-30 00:20:37 -07:00
Bob Wilson
b254041121 Merge remote-tracking branch 'origin/master' into master-next 2018-06-28 23:23:29 -07:00
Rintaro Ishizaki
bccfd85b70 [CodeComplete] Typecheck SubscriptDecl context prior to completion
Completing signature depends on its GenericEnvironment which is set
during typechecking. Previously, completing signature using generic type
used to cause assertion failure. e.g.

  extension Collection {
    subscript(some index: Int) -> Iterator.<COMPLETE HERE>

rdar://problem/41227754
2018-06-28 17:39:07 +09:00
swift-ci
c76deeb160 Merge remote-tracking branch 'origin/master' into master-next 2018-06-27 18:09:29 -07:00
swift-ci
d3a11186e0 Merge pull request #17577 from DougGregor/mangle-bound-generic-protocol 2018-06-27 17:57:47 -07:00
Doug Gregor
58c5b020cb [Mangling] Handle mangling involving bound generic "protocols".
When mangling a specialized use of a typealias in a protocol, we end up
with a "bound generic protocol" mangling, with the one substitution
replacing Self with some other type. Handle de-mangling and
re-mangling of such names.

Fixes rdar://problem/41549126.
2018-06-27 16:43:29 -07:00
swift-ci
ff7e1a9aa9 Merge remote-tracking branch 'origin/master' into master-next 2018-06-27 15:49:33 -07:00
Rintaro Ishizaki
52e3109231 [CodeComplete] Restore original type in getOperatorCompletions
In getOperatorCompletions(), for each every known operators, temporary
expressions are created and typechecked. In this process, typechecker
may set the type of the parsed expression. That may cause non-accurate
completion results or crash at worst.

rdar://problem/28188259
2018-06-27 19:35:25 +09:00
Rintaro Ishizaki
8c970ab26d [CodeComplete] Handle assign expression in sequence completion
rdar://problem/41232519
rdar://problem/41159258
2018-06-27 19:35:25 +09:00
swift-ci
73dfb54717 Merge remote-tracking branch 'origin/master' into master-next 2018-06-26 18:10:02 -07:00
Doug Gregor
15f4ee7216 [Type reconstruction] Produce an error with # of generic arguments mismatch. 2018-06-26 13:48:13 -07:00
Doug Gregor
b3e536b333 [Type Reconstruction] Guard against wrong # of generic args for a typealias.
When we are attempting to reconstruct a type node for a generic typealias,
make sure that we get the right number of generic arguments. If not,
fail gracefully rather than crashing.

Eventually, we should be able to handle this nested case.
2018-06-26 13:48:13 -07:00
swift-ci
72392fa5d2 Merge remote-tracking branch 'origin/master' into master-next 2018-06-25 20:29:48 -07:00
Mark Lacey
100bffd325 Remove redundant nested if statement.
Noticed while browsing code.

NFC.
2018-06-25 17:49:53 -07:00
swift-ci
d48f380bfc Merge remote-tracking branch 'origin/master' into master-next 2018-06-22 18:49:53 -07:00
swift-ci
1b1eef737f Merge pull request #17445 from dcci/mynongenericsignaturepain 2018-06-22 18:34:23 -07:00
Davide Italiano
f657cfb49a [TypeReconstruction] Don't crash on null genericSignatureMap.
<rdar://problem/41343572>
2018-06-22 16:18:27 -07:00
Bob Wilson
44712233c3 Merge remote-tracking branch 'origin/master' into master-next 2018-06-21 23:36:03 -07:00
Adrian Prantl
360b1687ac Remove support for the obsolete Qualified Archetype mangling from everywhere. 2018-06-21 16:15:17 -07:00
Bob Wilson
425bbf2975 Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 13:18:55 -07:00
Davide Italiano
0a6c3e3dc5 [TypeReconstruction] Dependent types can't have existential as bases.
This basically means the mangling isn't really quite valid, and
given we don't have a full compiler testcase to see what generates
this, we're going to reject this for now.

<rdar://problem/38931073>
2018-06-20 10:04:47 -07:00
Bob Wilson
ea055fcbdc Merge remote-tracking branch 'origin/master' into master-next 2018-06-19 22:47:54 -07:00
Davide Italiano
6c5206dd69 [TypeReconstruction] Fix reconstruction for associated types.
<rdar://problem/38931073>
2018-06-19 16:22:12 -07:00
swift-ci
7b3d6c02c6 Merge pull request #17328 from dcci/invalidmangl-typereco 2018-06-19 13:29:27 -07:00
Davide Italiano
6e627b5bb1 [TypeReconstruction] Don't choke on slightly invalid mangled names.
This was taken from a real project, but I don't have it anymore
and I can't reproduce it on newer versions of swift (probably
something changed in the DWARF type mangling). In any case, as
this can be triggered by user input, we shouldn't assert, and
error out instead.

<rdar://problem/39283717>
2018-06-19 11:37:03 -07:00
swift-ci
065d1d4f09 Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 18:30:27 -07:00
Rintaro Ishizaki
1ca88478a8 [Refactoring] Handle TupleShuffleExpr in "convert to trailing closure"
Fixes crash in "Convert To Trailing Closure" action if call has
defaulted parameters. Handle `TupleShuffleExpr` properly.

rdar://problem/41093898
2018-06-18 16:18:58 +09:00
swift-ci
4538ce9818 Merge remote-tracking branch 'origin/master' into master-next 2018-06-17 15:38:24 -07:00
John McCall
69f4dd1ec9 Generalize accessor storage to preserve the original accessor list.
Only not NFC because it's detectable by source tools.
2018-06-16 18:16:31 -04:00
Robert Widmann
a7c9bd09db Merge pull request #17181 from CodaFi/in-put-up-and-in-shut-up
[IDE] Scrub SwiftIDE of References to getInput()
2018-06-16 11:14:49 -07:00
swift-ci
bfe796b93e Merge remote-tracking branch 'origin/master' into master-next 2018-06-16 01:32:31 -07:00
Doug Gregor
18569e5f77 Merge pull request #16963 from DougGregor/evaluator-type-checker
[Type checker] Use the request-evaluator in the type checker.
2018-06-15 22:41:31 -07:00
swift-ci
5bd074fbc2 Merge remote-tracking branch 'origin/master' into master-next 2018-06-15 14:29:10 -07:00
Robert Widmann
b7580493f5 [Gardening] 'throw' is not an expression keyword
Remove the workaround in CodeCompletion for this.
2018-06-15 13:25:06 -07:00
Doug Gregor
b7fbe57bf9 [AST] Remove “validated” bit from TypeLoc.
TypeLocs have been “validated” when they have a non-null Type, so eliminate
the separate “validated” bit that was out-of-sync with the Type field.
2018-06-14 15:29:57 -07:00
swift-ci
de6f9b5633 Merge remote-tracking branch 'origin/master' into master-next 2018-06-14 12:09:47 -07:00
Davide Italiano
ec40a5414c [TypeReconstruction] Fix reconstruction for existential metatypes.
Without this, we wouldn't be able to show an array of `Any.Type`
in the debugger.

Fixes <rdar://problem/40940701>.
2018-06-14 10:30:02 -06:00
swift-ci
09ffbea54b Merge remote-tracking branch 'origin/master' into master-next 2018-06-13 21:28:57 -07:00