Skip to content

Tweak a few generic signatures to work around a bug in the Requirement Machine #199

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 4, 2022

Here is the reduced test case:

func foo<C : Collection, R : Sequence>(_: C, _: R) where C.SubSequence == Substring, C.Element == R.Element {}

The Requirement Machine produces a valid but different minimization than the GenericSignatureBuilder for this signature, which flags the assert since right now we run both and compare the results:

error: compile command failed due to signal 6 (use -v to see invocation)
RequirementMachine generic signature minimization is broken:
RequirementMachine says:      <C, R where C : Collection, R : Sequence, C.[Sequence]Element == R.[Sequence]Element, C.[Collection]SubSequence == Substring>
GenericSignatureBuilder says: <C, R where C : Collection, R : Sequence, C.[Collection]SubSequence == Substring, R.[Sequence]Element == Character>

Radar tracking the fix: rdar://problem/89791117

…t Machine

Here is the reduced test case:

    func foo<C : Collection, R : Sequence>(_: C, _: R) where C.SubSequence == Substring, C.Element == R.Element {}

The Requirement Machine produces a valid but different minimization than the
GenericSignatureBuilder for this signature, which flags the assert since
right now we run both and compare the results:

    error: compile command failed due to signal 6 (use -v to see invocation)
    RequirementMachine generic signature minimization is broken:
    RequirementMachine says:      <C, R where C : Collection, R : Sequence, C.[Sequence]Element == R.[Sequence]Element, C.[Collection]SubSequence == Substring>
    GenericSignatureBuilder says: <C, R where C : Collection, R : Sequence, C.[Collection]SubSequence == Substring, R.[Sequence]Element == Character>

Radar tracking the fix: rdar://problem/89791117
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@stephentyrone
Copy link
Contributor

@swift-ci test macOS

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please revert if/when fixed.

@slavapestov slavapestov merged commit 39c54d3 into swiftlang:main Mar 8, 2022
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.

3 participants