Skip to content
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

Conversation

DougGregor
Copy link
Member

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.

…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
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@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.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit c063d49 into apple:master Jun 30, 2017
@DougGregor DougGregor deleted the gsb-no-unresolved-potential-archetypes branch June 30, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants