mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
clean up subs
value interface type
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user