Skip to content

Conversation

@slavapestov
Copy link
Contributor

We need to serialize the underlying type substitution map for an inlinable function. However, there is no reason to deserialize it eagerly, since doing so can lead to cycles. It is better for correctness and performance to only deserialize it when needed.

Technically this fixes a regression from #84299, but the actual problem was there all along, it was just exposed by my change on a specific project.

Fixes rdar://163301203.

GenericParamList *genericParams;
SET_OR_RETURN_ERROR(genericParams, MF.maybeReadGenericParams(declContext));

// FIXME: Do we still need exportUnderlyingType?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xymus This looks like it was put in as a temporary workaround for the very same issue, is there any reason to keep it now?

@slavapestov slavapestov force-pushed the lazy-opaque-type-decl branch from 6c93afa to 0c004ee Compare November 19, 2025 23:40
…utions

We need to serialize the underlying type substitution map for an
inlinable function. However, there is no reason to deserialize it
eagerly, since doing so can lead to cycles. It is better for
correctness and performance to only deserialize it when needed.

Technically this fixes a regression from swiftlang#84299, but the actual
problem was there all along, it was just exposed by my change
on a specific project.

Fixes rdar://163301203.
@slavapestov slavapestov force-pushed the lazy-opaque-type-decl branch from 0c004ee to 2709743 Compare November 20, 2025 23:20
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

@slavapestov slavapestov merged commit fa55b25 into swiftlang:main Nov 21, 2025
3 checks passed
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