Skip to content

Commit 3d9e490

Browse files
authored
Merge pull request #82295 from hamishknight/wrapping-paper
2 parents fcd94f1 + 89a7014 commit 3d9e490

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/Sema/CodeSynthesis.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,12 @@ static ParamDecl *createMemberwiseInitParameter(DeclContext *DC,
230230
// memberwise initializer will be in terms of the backing storage
231231
// type.
232232
if (var->isPropertyMemberwiseInitializedWithWrappedType()) {
233-
varInterfaceType = var->getPropertyWrapperInitValueInterfaceType();
233+
if (auto initTy = var->getPropertyWrapperInitValueInterfaceType()) {
234+
varInterfaceType = initTy;
234235

235-
auto initInfo = var->getPropertyWrapperInitializerInfo();
236-
isAutoClosure = initInfo.getWrappedValuePlaceholder()->isAutoClosure();
236+
auto initInfo = var->getPropertyWrapperInitializerInfo();
237+
isAutoClosure = initInfo.getWrappedValuePlaceholder()->isAutoClosure();
238+
}
237239
} else {
238240
varInterfaceType = backingPropertyType;
239241
}

validation-test/compiler_crashers_2/5716fcca10bf3ff7.swift renamed to validation-test/compiler_crashers_2_fixed/5716fcca10bf3ff7.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// {"signature":"createImplicitConstructor(swift::NominalTypeDecl*, ImplicitConstructorKind, swift::ASTContext&)"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck -swift-version 5 %s
33
struct a @propertyWrapper struct b < c {
44
wrappedValue : c
55
} @propertyWrapper struct d {

0 commit comments

Comments
 (0)