-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Consider the superclass bound of archetypes in searchTypeMetadata #20827
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
IRGen: Consider the superclass bound of archetypes in searchTypeMetadata #20827
Conversation
We need to search the type metadata of superclass bounds to handle signatures like: class K<T> {} $@convention(witness_method: A2) <τ_0_0><τ_1_0 where τ_0_0 : K<τ_1_0>, τ_1_0 : C> (@in_guaranteed τ_0_0) -> () rdar://46173958 SR-9305
@swift-ci Please test |
lib/IRGen/Fulfillment.cpp
Outdated
@@ -124,6 +124,15 @@ bool FulfillmentMap::searchTypeMetadata(IRGenModule &IGM, CanType type, | |||
source, MetadataPath(path), keys); | |||
} | |||
|
|||
// If the type is an archetype consider its super class bound. | |||
if (isa<ArchetypeType>(type)) | |||
if (metadataState == MetadataState::Complete) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be the same condition as below, i.e. metadataState == MetadataState::Complete && keys.isInterestingType(type))
rather than checking specifically for ArchetypeType
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will lift the restriction. Is interestingType(type) is checked earlier.
… (checked earlier)
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please smoke test |
@swift-ci Please test |
Build failed |
Build failed |
We need to search the type metadata of superclass bounds to handle signatures like:
class K {}
$@convention(witness_method: A2) <τ_0_0><τ_1_0 where τ_0_0 : K<τ_1_0>, τ_1_0 : C> (@in_guaranteed τ_0_0) -> ()
rdar://46173958
SR-9305