Skip to content

[Serialization] Ensure we run InheritedTypeRequest before serializing inherited type #78899

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 1 commit into from
Feb 5, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 25, 2025

When using -experimental-skip-all-function-bodies we don’t run the TypeCheckSourceFileRequest and thus don’t go through the decl checker, which calls InheritedTypeRequest on all inheritance clauses. This means that the inherited entries are not populated by the time we serialize the module. Trigger the computation of inherited entries by calling InheritedTypeRequest during serialization.

Unfortunately, we can’t use the type returned by getResolvedType for the serialization because getResolvedType returns an inverted protocol type for suppressed conformances but during serialization, we want to serialize the suppressed type with a isSuppressedBit. We thus need to call getEntry(i).getType() again to get the type to serialize.

rdar://141440011


Thanks @hamishknight for the pointer what might be causing this issue.

@ahoppen ahoppen marked this pull request as ready for review January 25, 2025 00:31
@ahoppen
Copy link
Member Author

ahoppen commented Jan 25, 2025

@swift-ci Please smoke test

@ahoppen ahoppen changed the title [Serialization] Use InheritedEntries.getResolvedType to determine type to serialize into interface [Serialization] Ensure we run InheritedTypeRequest before serializing inherited type Jan 25, 2025
@ahoppen ahoppen requested a review from nate-chandler January 25, 2025 16:52
@ahoppen
Copy link
Member Author

ahoppen commented Jan 25, 2025

@swift-ci Please smoke test

@ahoppen
Copy link
Member Author

ahoppen commented Jan 26, 2025

@swift-ci Please smoke test

@ahoppen
Copy link
Member Author

ahoppen commented Jan 26, 2025

@swift-ci Please smoke test

…ng inherited type

When using `-experimental-skip-all-function-bodies` we don’t run the `TypeCheckSourceFileRequest` and thus don’t go through the decl checker, which calls `InheritedTypeRequest` on all inheritance clauses. This means that the inherited entries are not populated by the time we serialize the module. Trigger the computation of inherited entries by calling `InheritedTypeRequest` during serialization.

Unfortunately, we can’t use the type returned by `getResolvedType` for the serialization because `getResolvedType` returns an inverted protocol type for suppressed conformances but during serialization, we want to serialize the suppressed type with a `isSuppressedBit`. We thus need to call `getEntry(i).getType()` again to get the type to serialize.

rdar://141440011
@ahoppen
Copy link
Member Author

ahoppen commented Jan 27, 2025

@swift-ci Please test

@ahoppen ahoppen merged commit fc2ee36 into swiftlang:main Feb 5, 2025
5 checks passed
@ahoppen ahoppen deleted the rdar141440011 branch February 5, 2025 02:36
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