swift
[IDE] Fix another GenericFunctionType subst crasher
#38503
Merged

[IDE] Fix another GenericFunctionType subst crasher #38503

hamishknight
hamishknight4 years ago (edited 4 years ago)

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

hamishknight hamishknight requested a review from slavapestov slavapestov 4 years ago
hamishknight hamishknight requested a review from rintaro rintaro 4 years ago
hamishknight [IDE] Use method result type for getTypeOfMember call
73027925
hamishknight [AST] Reject GenericFunctionType in TypeBase::getTypeOfMember
d4c25f55
hamishknight hamishknight force pushed to d4c25f55 4 years ago
slavapestov
slavapestov approved these changes on 2021-07-20
hamishknight
hamishknight4 years ago

@swift-ci please test source compatibility

hamishknight
hamishknight4 years ago
swiftlang swiftlang deleted a comment from swift-ci on 2021-07-20
rintaro
rintaro approved these changes on 2021-07-20
hamishknight hamishknight merged ab594ddc into main 4 years ago
hamishknight hamishknight deleted the another-one-bites-the-subst branch 4 years ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone