Skip to content

RequirementMachine: Leave behind conflicting requirements in the minimized signature #61064

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 Sep 13, 2022

Requirement lowering only expects that it won't see two requirements
of the same kind (except for conformance requirements). So only mark
those as conflicting.

This addresses a crash-on-invalid and improves diagnostics for
move-only generics, because a conflict won't drop the copyability
of a generic parameter and expose a move-only-naive user to
confusing error messages.

Fixes #61031.
Fixes #63997.
Fixes rdar://problem/111991454.

@@ -0,0 +1,16 @@
// RUN: %target-typecheck-verify-swift
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind sticking to the issue-* format for file names? This is the one I'm planning to use once I start renaming all the sr* files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

@slavapestov slavapestov force-pushed the rqm-conflicting-rules-can-remain branch from 746050b to f100708 Compare February 15, 2024 19:03
…mized signature

Requirement lowering only expects that it won't see two requirements
of the same kind (except for conformance requirements). So only mark
those as conflicting.

This addresses a crash-on-invalid and improves diagnostics for
move-only generics, because a conflict won't drop the copyability
of a generic parameter and expose a move-only-naive user to
confusing error messages.

Fixes swiftlang#61031.
Fixes swiftlang#63997.
Fixes rdar://problem/111991454.
@slavapestov slavapestov force-pushed the rqm-conflicting-rules-can-remain branch from f100708 to 70c9f8a Compare February 15, 2024 19:32
@slavapestov slavapestov marked this pull request as ready for review February 15, 2024 19:33
@slavapestov slavapestov changed the title RequirementMachine: Don't filter out conflicting rules RequirementMachine: Leave behind conflicting requirements in the minimized signature Feb 15, 2024
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 7e4761a into swiftlang:main Feb 15, 2024
Comment on lines +240 to +241
// EXT_ASSOC_MEMBER_2: Begin completions, {{.*}} items
// EXT_ASSOC_MEMBER_2: Keyword/None: Type[#Int.Type#];
Copy link
Member

Choose a reason for hiding this comment

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

This is a regression. Do you know how it used to get parsed or why the behavior might have changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants