Skip to content

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

Merged

Conversation

aschwaighofer
Copy link
Contributor

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

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
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@@ -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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e2a8300

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6a54c36

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6a54c36

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 14ff9c1

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 14ff9c1

@aschwaighofer aschwaighofer merged commit 8a27e89 into swiftlang:master Nov 28, 2018
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.

3 participants