Merge pull request #75011 from hamishknight/context-is-key

[Sema] Enforce PatternTypeRequest returns contextual type
This commit is contained in:
Hamish Knight
2024-07-07 10:23:57 +01:00
committed by GitHub
13 changed files with 45 additions and 60 deletions

View File

@@ -163,12 +163,11 @@ static ValueDecl *deriveProperty(DerivedConformance &derived, Type type,
VarDecl *propDecl;
PatternBindingDecl *pbDecl;
std::tie(propDecl, pbDecl) = derived.declareDerivedProperty(
DerivedConformance::SynthesizedIntroducer::Var, name, type, type,
DerivedConformance::SynthesizedIntroducer::Var, name, type,
/*isStatic=*/false, /*isFinal=*/false);
// Define the getter.
auto *getterDecl = derived.addGetterToReadOnlyDerivedProperty(
propDecl, type);
auto *getterDecl = derived.addGetterToReadOnlyDerivedProperty(propDecl);
// Synthesize the body.
synthesizer(getterDecl);