[Sema] Add null check in createMemberwiseInitParameter

The property wrapper initializer info may be null if e.g we had a
request cycle, just use the property's interface type in that case.

rdar://82899428
This commit is contained in:
Hamish Knight
2025-06-17 15:16:44 +01:00
parent 8acde34ab5
commit 89a7014db9
2 changed files with 6 additions and 4 deletions

View File

@@ -230,10 +230,12 @@ static ParamDecl *createMemberwiseInitParameter(DeclContext *DC,
// memberwise initializer will be in terms of the backing storage
// type.
if (var->isPropertyMemberwiseInitializedWithWrappedType()) {
varInterfaceType = var->getPropertyWrapperInitValueInterfaceType();
if (auto initTy = var->getPropertyWrapperInitValueInterfaceType()) {
varInterfaceType = initTy;
auto initInfo = var->getPropertyWrapperInitializerInfo();
isAutoClosure = initInfo.getWrappedValuePlaceholder()->isAutoClosure();
auto initInfo = var->getPropertyWrapperInitializerInfo();
isAutoClosure = initInfo.getWrappedValuePlaceholder()->isAutoClosure();
}
} else {
varInterfaceType = backingPropertyType;
}