Skip to content

Sema: Fix the insertion location for conformances attributes #82452

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 2 commits into from
Jun 26, 2025
Merged

Conversation

AnthonyLatsis
Copy link
Collaborator

We were using ProtocolNameLoc for the insertion location, which is not necessarily the start location of the TypeRepr associated with the conformance:

warning: conformance of 'S' to 'P' should be marked 'nonisolated' to retain its behavior with upcoming feature 'InferIsolatedConformances' [isolated_conformance_will_become_nonisolated] [#IsolatedConformances]
@MainActor struct S: @unsafe Nested.P {}
                                    ^
                                    nonisolated

Fixes rdar://132570262.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

"@" + globalActorIsolation.getString() + " ");
// Take permanent ownership of the string. The diagnostic may outlive this
// function call.
auto globalActorTypeStr = ctx.AllocateCopy(globalActorType.getString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR but I think the engine should take ownership of all the arguments, we already do that for diagnostic transactions and might as well do it for the diagnostics in general to avoid surprises.

@AnthonyLatsis AnthonyLatsis requested a review from DougGregor June 25, 2025 03:45
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test Linux

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

/// The `TypeRepr` of the inheritance clause entry from which this nominal was
/// sourced, if any. For example, if this is a conformance to `Y` declared as
/// `struct S: X, Y & Z {}`, this is the `TypeRepr` for `Y & Z`.
TypeRepr *inheritedTypeRepr;
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for adding this!

@AnthonyLatsis AnthonyLatsis merged commit 1f89bb6 into main Jun 26, 2025
3 checks passed
@AnthonyLatsis AnthonyLatsis deleted the jepa2 branch June 26, 2025 20:38
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