Skip to content

Commit 0409102

Browse files
authored
Merge pull request #82304 from hamishknight/wrapping-paper-6.2
2 parents 5384c54 + 61e0326 commit 0409102

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
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
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"signature":"createImplicitConstructor(swift::NominalTypeDecl*, ImplicitConstructorKind, swift::ASTContext&)"}
2+
// RUN: not %target-swift-frontend -typecheck -swift-version 5 %s
3+
struct a @propertyWrapper struct b < c {
4+
wrappedValue : c
5+
} @propertyWrapper struct d {
6+
var wrappedValue @b var e : a @d var f

0 commit comments

Comments
 (0)