Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Oct 30, 2024

This predicate is meant to ask if the loweredType is equal to getLoweredType(pattern, formalType) for some abstraction pattern.

If the formal type contained an opaque archetype, we performed a different check, because we asked if loweredEqual is equal to getLoweredType(AbstractionPattern(formalType), formalType).

This caused a spurious SIL verifier failure when the payload of an existential contained an opaque archetype, because we lower the payload with the most general AbstractionPattern, so that @thin metatypes become @thick, etc.

The regression test exercises this bug, and also another bug that was present in 6.0 but was already fixed on main by one of my earlier refactorings.

Fixes rdar://problem/138655637.

This predicate is meant to ask if the loweredType is equal to
`getLoweredType(pattern, formalType)` for *some* abstraction pattern.

If the formal type contained an opaque archetype, we performed a
different check, because we asked if loweredEqual is equal to
`getLoweredType(AbstractionPattern(formalType), formalType)`.

This caused a spurious SIL verifier failure when the payload of an
existential contained an opaque archetype, because we lower the
payload with the most general AbstractionPattern, so that
@thin metatypes become @thick, etc.

The regression test exercises this bug, and also another bug that was
present in 6.0 but was already fixed on main by one of my earlier
refactorings.

Fixes rdar://problem/138655637.
@slavapestov slavapestov requested a review from jckarter as a code owner October 30, 2024 17:20
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

@slavapestov slavapestov merged commit dc74ebf into swiftlang:main Oct 31, 2024
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