mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user