File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,25 @@ static std::shared_ptr<CompileTimeValue> extractCompileTimeValue(Expr *expr) {
311
311
return extractCompileTimeValue (underlyingToOpaque->getSubExpr ());
312
312
}
313
313
314
+ case ExprKind::DefaultArgument: {
315
+ auto defaultArgExpr = cast<DefaultArgumentExpr>(expr);
316
+ auto *decl = defaultArgExpr->getParamDecl ();
317
+ // If there is a default expr, we should have looked through to it
318
+ assert (!decl->hasDefaultExpr ());
319
+ switch (decl->getDefaultArgumentKind ()) {
320
+ case DefaultArgumentKind::NilLiteral:
321
+ return std::make_shared<RawLiteralValue>(" nil" );
322
+ case DefaultArgumentKind::EmptyArray:
323
+ return std::make_shared<ArrayValue>(
324
+ std::vector<std::shared_ptr<CompileTimeValue>>());
325
+ case DefaultArgumentKind::EmptyDictionary:
326
+ return std::make_shared<DictionaryValue>(
327
+ std::vector<std::shared_ptr<TupleValue>>());
328
+ default :
329
+ break ;
330
+ }
331
+ } break ;
332
+
314
333
default : {
315
334
break ;
316
335
}
You can’t perform that action at this time.
0 commit comments