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

@@ -3357,15 +3357,7 @@ void DelayedArgument::emitDefaultArgument(SILGenFunction &SGF,
auto pbd = var->getParentPatternBinding(); auto pbd = var->getParentPatternBinding();
auto entry = pbd->getPatternEntryForVarDecl(var); auto entry = pbd->getPatternEntryForVarDecl(var);
auto subs = info.defaultArgsOwner.getSubstitutions();
SubstitutionMap subs;
auto *genericEnv = ctor->getGenericEnvironmentOfContext();
auto typeGenericSig =
var->getDeclContext()->getGenericSignatureOfContext();
if (genericEnv && typeGenericSig) {
subs = info.defaultArgsOwner.getSubstitutions();
}
value = SGF.emitApplyOfStoredPropertyInitializer(info.loc, value = SGF.emitApplyOfStoredPropertyInitializer(info.loc,
entry, subs, entry, subs,

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. // 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 // Note, this will always be the sugared T? because we don't default init an
// explicit Optional<T>. // explicit Optional<T>.
if (isa<OptionalType>(var->getType().getPointer()) && if (isa<OptionalType>(var->getValueInterfaceType().getPointer()) &&
!var->getParentInitializer()) !var->getParentInitializer())
arg->setDefaultArgumentKind(DefaultArgumentKind::NilLiteral); arg->setDefaultArgumentKind(DefaultArgumentKind::NilLiteral);
} }