@@ -498,16 +498,27 @@ DerivedConformance::declareDerivedPropertyGetter(VarDecl *property,
498498 return getterDecl;
499499}
500500
501+ static VarDecl::Introducer
502+ mapIntroducer (DerivedConformance::SynthesizedIntroducer intro) {
503+ switch (intro) {
504+ case DerivedConformance::SynthesizedIntroducer::Let:
505+ return VarDecl::Introducer::Let;
506+ case DerivedConformance::SynthesizedIntroducer::Var:
507+ return VarDecl::Introducer::Var;
508+ }
509+ llvm_unreachable (" Invalid synthesized introducer!" );
510+ }
511+
501512std::pair<VarDecl *, PatternBindingDecl *>
502- DerivedConformance::declareDerivedProperty (Identifier name,
513+ DerivedConformance::declareDerivedProperty (SynthesizedIntroducer intro,
514+ Identifier name,
503515 Type propertyInterfaceType,
504516 Type propertyContextType,
505517 bool isStatic, bool isFinal) {
506518 auto parentDC = getConformanceContext ();
507519
508- VarDecl *propDecl = new (Context)
509- VarDecl (/* IsStatic*/ isStatic, VarDecl::Introducer::Var,
510- SourceLoc (), name, parentDC);
520+ VarDecl *propDecl = new (Context) VarDecl (
521+ /* IsStatic*/ isStatic, mapIntroducer (intro), SourceLoc (), name, parentDC);
511522 propDecl->setImplicit ();
512523 propDecl->setSynthesized ();
513524 propDecl->copyFormalAccessFrom (Nominal, /* sourceIsParentContext*/ true );
0 commit comments