Skip to content

Fetch associated types abstractly when fetching an associated conformance #34213

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

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Oct 7, 2020

By default, emitTypeMetadataRef does a blocking request for complete metadata, which is the right thing to do for most purposes in IRGen. Unfortunately, it's actively dangerous in code that can be called during metadata completion, like an associated conformance accessor because it can cause artificial dependency cycles that the runtim isn't equipped to detect, much less solve.

This is a partial fix for rdar://69901318, which also exposes a bad metadata access path that seems to be causing an artificial problem.

…ance.

By default, emitTypeMetadataRef does a blocking request for complete
metadata, which is the right thing to do for most purposes in IRGen.
Unfortunately, it's actively dangerous in code that can be called
during metadata completion, like an associated conformance accessor,
because it can cause artificial dependency cycles that the runtime
isn't equipped to detect, much less solve.

This is a partial fix for rdar://69901318, which also exposes a bad
metadata access path that seems to be causing an artificial problem.
@rjmccall
Copy link
Contributor Author

rjmccall commented Oct 7, 2020

@swift-ci Please test.

@rjmccall rjmccall merged commit 171e0e2 into swiftlang:main Oct 7, 2020
@rjmccall rjmccall deleted the abstract-assoc-type-for-conformance branch October 7, 2020 15:22
rjmccall added a commit to rjmccall/swift that referenced this pull request Oct 8, 2020
Still not sure how the test run didn't catch this.

rdar://70104537
rjmccall added a commit that referenced this pull request Oct 9, 2020
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.

1 participant