Skip to content

[IDE] Fix another GenericFunctionType subst crasher #38503

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 2 commits into from
Jul 20, 2021

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jul 20, 2021

When matching methods for the conforming types SourceKit request, we were using the method's interface type in a call to TypeBase::getTypeOfMember, which could lead to crashes when calling subst with a GenericFunctionType. Instead, pass the result type only, as that's all we want anyway.

Then change TypeBase::getTypeOfMember to enforce that a GenericFunctionType isn't passed as the memberType parameter to avoid other callers making the same mistake.

rdar://77259607

Previously we were defaulting to the method's
interface type, which could lead to calling `subst`
with a GenericFunctionType. Instead, pass the
result type only, as that's all we want anyway.

rdar://77259607
Remove the default argument for the `memberType`
parameter and enforce that GenericFunctionType is
not passed. Also add a defaulted overload for the
property case, as they should never have a
GenericFunctionType interface type.
@hamishknight hamishknight force-pushed the another-one-bites-the-subst branch from 4586b12 to d4c25f5 Compare July 20, 2021 13:11
@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#3111

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci Jul 20, 2021
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