clean up subs

value interface type
This commit is contained in:
Azoy
2019-03-15 00:06:17 -05:00
parent bc7cb332df
commit 2bd99eecae
2 changed files with 2 additions and 10 deletions

View File

@@ -1679,7 +1679,7 @@ static void maybeAddMemberwiseDefaultArg(ParamDecl *arg, VarDecl *var,
// to nil literal. This is useful when we need to print the constructor.
// Note, this will always be the sugared T? because we don't default init an
// explicit Optional<T>.
if (isa<OptionalType>(var->getType().getPointer()) &&
if (isa<OptionalType>(var->getValueInterfaceType().getPointer()) &&
!var->getParentInitializer())
arg->setDefaultArgumentKind(DefaultArgumentKind::NilLiteral);
}