Commit Graph

171 Commits

Author SHA1 Message Date
Doug Gregor
2cb23fb8d7 Revert "Reinstate "AST: Fix excessive deserialization in GenericSignatureBuilder""
This reverts commit 464dac7c51.
2017-02-16 13:38:12 -08:00
Doug Gregor
464dac7c51 Reinstate "AST: Fix excessive deserialization in GenericSignatureBuilder"
This reverts commit d3926d1b09.
2017-02-16 10:59:24 -08:00
Jordan Rose
d3926d1b09 Revert "AST: Fix excessive deserialization in GenericSignatureBuilder" 2017-02-16 09:17:24 -08:00
Slava Pestov
62b650af83 AST: Fix excessive deserialization in GenericSignatureBuilder
When we're looking up all associated types with the same name in order
to find the right archetype anchor, skip extension members to avoid
circular deserialization.

Discovered while investigating <rdar://problem/30248571>.
2017-02-15 17:01:44 -08:00
Slava Pestov
41eba98902 Gardening: Fix some unused variable warnings in no-assert builds 2017-02-15 12:57:35 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Doug Gregor
58f181a470 [Generic signature builder] Eliminate "concrete type in path" checks.
We no longer need the "concrete type in path" checks to correctly
order potential archetypes, and they prohibit us from making the
representative always the archetype anchor.
2017-02-13 13:59:17 -08:00
Doug Gregor
9118a0488c [Generic signature builder] Eliminate isBetterArchetypeAnchor.
It's just a wrapper around compareDependentTypes() that was only used
for assertions.
2017-02-13 13:03:14 -08:00
Doug Gregor
0df3adb7a3 [Generic signature builder] Align the representative with the archetype anchor.
Make the representative of an equivalence class also be the archetype
anchor, so we don't need to walk through the equivalence class each
time we need the archetype anchor.
2017-02-13 13:03:13 -08:00
Doug Gregor
189f8a7843 [Generic signature builder] Align isBetterArchetypeAnchor and compareDependentTypes.
The latter was also performing the concrete-type-in-path check; do
that within compareDependentTypes(); we don't want a different here.
2017-02-13 13:03:13 -08:00
Doug Gregor
e3479e25fc [Generic signature builder] Concrete constraints across equivalence classes.
When emitting a requirement for a same-type-to-concrete constraint,
use the known concrete source for just the first of the component
anchors. For the rest, we need to explicitly model the constraint lest
it get lost. Fixes rdar://problem/30478915.
2017-02-13 12:49:09 -08:00
Doug Gregor
f6915546a2 [Generic signature builder] Ordering of nested types doesn't matter.
... so don't treat typealias-bound nested types as special.
2017-02-13 12:48:54 -08:00
practicalswift
3e40296cfa [gardening] Fix inconsistent headers 2017-02-13 15:21:52 +01:00
Slava Pestov
e8bd2cb367 AST: Targeted fix to prevent 0059-sr3321.swift from regressing 2017-02-12 00:51:25 -08:00
Doug Gregor
b6d54431cb Merge pull request #7398 from huonw/gsb-cleanups
[Generic signature builder] Substitute requirements instead of threading a PA around.
2017-02-11 18:48:05 -08:00
Doug Gregor
416d935df6 [Generic signature builder] Use addSameTypeRequirementBetweenArchetypes consistently.
Rather than trying to set the representative directly when adding
implicit requirements, use addSameTypeRequirementBetweenArchetypes()
consistently.
2017-02-11 00:04:12 -08:00
Huon Wilson
923113d912 [Generic signature builder] switch (...), not chained if (... ==). 2017-02-10 18:59:11 -08:00
Huon Wilson
f1dba0e7e8 [Generic signature builder] Substitute requirements instead of threading a PA around.
This essentially undoes the implementation in 51da51dfc0, which
implicitly did a substitution of the Self type in a protocol's
requirement signature by threading around the replacement PA. This is
brittle because every part of the code needs to take and pass around the
argument. By preemptively substituting, the whole requirement is in the
right form from the time it enters `addRequirement`.

The infrastructure here also allows simplifying some code.
2017-02-10 18:58:56 -08:00
Huon Wilson
dd597cce74 [Generic signature builder] Use the builder's param array properly in getDependentType. 2017-02-10 18:56:36 -08:00
Huon Wilson
38dc70f4c0 [Generic signature builder] Include the parent in the name of a typealias PA. 2017-02-10 18:56:35 -08:00
Doug Gregor
579af863c5 Rename ArchetypeBuilder -> GenericSignatureBuilder 2017-02-10 12:46:34 -08:00