New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSB] Stop creating unresolved potential archetypes. #10714
Merged
swift-ci
merged 7 commits into
apple:master
from
DougGregor:gsb-no-unresolved-potential-archetypes
Jun 30, 2017
Merged
[GSB] Stop creating unresolved potential archetypes. #10714
swift-ci
merged 7 commits into
apple:master
from
DougGregor:gsb-no-unresolved-potential-archetypes
Jun 30, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ection. The small-but-significant change to the generic signature builder is to refuse to create unresolved potential archetypes. Instead, delay any requirement that depends on such type, to be reprocessed once we've seen all of the other requirements. If the type can be resolved later, it will be; Otherwise, the type checker will complain when it sees an unresolvable type. By itself, this fixes the crash in SR-2796. Doing this by itself regresses diagnostics because typo correction in the generic signature builder no longer kicks in. Therefore, implement typo correction for these cases in the type checker proper, using its existing facilities for typo correction. The result is more consistent code with a better result. Fixes SR-2796 / rdar://problem/28544316.
Remove typo correction and all notions of "renamed" potential archetypes from the generic signature builder. They're no longer used anywhere.
…pes. All of this is dead code now that we don't use ArchetypeResolutionKind::AlwaysPartial and, therefore, cannot ever produce an unresolved potential archetype.
We no longer set this bit anywhere, so remove it. NFC
@swift-ci please smoke test and merge |
@swift-ci please smoke test |
…entType(). We don't need this now that there are no more unresolved types.
Fixes two crashers that regressed with the reimplementation of typo correction for nested types of dependent types, and addresses one more existing crasher.
@swift-ci please smoke test and merge |
Fixes a crasher regression.
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stop creating "unresolved" potential archetypes in the
GenericSignatureBuilder
. This means we only form a new potential archetype when we already know what associated type or concrete type it refers to, so we know that it is well-formed. If we are unable to resolve a type, delay the corresponding requirement so we can process it later.Move the typo correction logic for unresolved potential archetypes from the
GenericSignatureBuilder
to the type checker proper, where we can reuse common infrastructure. This improves diagnostics (e.g., when we're trying to typo-correct to a type in a superclass found via a superclass constraint) and avoids some DRY violations.Overall, we get to rip out a big pile of dodgy code.
Fixes SR-2796 / rdar://problem/28544316.