Skip to content

Eliminate witness markers #5704

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

Merged
merged 4 commits into from
Nov 10, 2016

Conversation

DougGregor
Copy link
Member

This pull request eliminates the notion of "witness markers" from the frontend. To do so, introduce a new operation on generic signatures,
enumeratePairedRequirements(), which invokes a callback with each
(dependent type, set-of-conformance-requirements) pair that needs to
be recorded within substitutions. Switch the last two remaining
consumers of witness markers (GenericSignature::getAllDependentTypes()
and GenericSignature::getSubstitutions()) over to this new entrypoint. Then delete all notions of witness markers.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

Oops, this is going to fail:

    Swift(macosx-x86_64) :: Generics/associated_type_typo.swift
    Swift(macosx-x86_64) :: Generics/requirement_inference.swift
    Swift(macosx-x86_64) :: Generics/superclass_constraint.swift
    Swift(macosx-x86_64) :: Prototypes/CollectionTransformers.swift
    Swift(macosx-x86_64) :: Reflection/typeref_lowering.swift

Introduce a new operation on generic signatures,
enumeratePairedRequirements(), which invokes a callback with each
(dependent type, set-of-conformance-requirements) pair that needs to
be recorded within substitutions. Switch the last two remaining
consumers of witness markers (GenericSignature::getAllDependentTypes()
and GenericSignature::getSubstitutions()) over to this new entrypoint.
…tion.

Substitution into a generic function type can map type parameters to
other type parameters. In some cases, this was introducing duplicate
type parameters, e.g., if two type parameters in the original
signature mapped down to a single type parameter in the substituted
signature. Sort/unique the resulting type parameters so we don't break
invariants.
@DougGregor DougGregor force-pushed the eliminate-witness-markers branch from 7651738 to 15db826 Compare November 10, 2016 06:11
@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 7a451a6 into swiftlang:master Nov 10, 2016
@DougGregor DougGregor deleted the eliminate-witness-markers branch November 10, 2016 07:42
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.

2 participants