Fix based on review comments

This commit is contained in:
zoecarver
2019-11-06 11:02:57 -08:00
parent 327c08a983
commit 00ebbee341
2 changed files with 5 additions and 1 deletions

View File

@@ -5399,7 +5399,8 @@ Expr *ExprRewriter::coerceCallArguments(Expr *arg, AnyFunctionType *funcType,
// Otherwise, create a call of the default argument generator.
} else {
const ParamDecl *defaultParam = getParameterAt(cast<ValueDecl>(callee.getDecl()), newArgs.size());
const ParamDecl *defaultParam = getParameterAt(callee.getDecl(),
newArgs.size());
defArg = defaultParam->getDefaultValue();
if (defArg == nullptr) {

View File

@@ -397,7 +397,10 @@ func subscripts<T: Hashable, U: Hashable>(x: T, y: U, s: String) {
_ = \SubscriptDefaults1.[bool: false, 0, 0]
_ = \SubscriptDefaults2.[]
_ = \SubscriptDefaults2.[0]
_ = \SubscriptDefaults3.[]
_ = \SubscriptDefaults3.[0]
}
// CHECK-LABEL: sil hidden [ossa] @{{.*}}subclass_generics