Sema: Subscript default arguments

Fixes <https://bugs.swift.org/browse/SR-6118>.
This commit is contained in:
Slava Pestov
2019-04-02 01:37:56 -04:00
parent 043d76a3bf
commit 6bb36b5c01
19 changed files with 308 additions and 44 deletions

View File

@@ -821,8 +821,6 @@ ERROR(untyped_pattern_ellipsis,none,
"'...' cannot be applied to a subpattern which is not explicitly typed", ())
ERROR(no_default_arg_closure,none,
"default arguments are not allowed in closures", ())
ERROR(no_default_arg_subscript,none,
"default arguments are not allowed in subscripts", ())
ERROR(no_default_arg_curried,none,
"default arguments are not allowed in curried parameter lists", ())
ERROR(var_pattern_in_var,none,

View File

@@ -1098,8 +1098,8 @@ public:
/// all the arguments, not just those that have default arguments.
unsigned claimNextIndex() { return NextIndex++; }
/// Set the parsed context for all the initializers to the given
/// function.
/// Set the parsed context of all default argument initializers to
/// the given function, enum case or subscript.
void setFunctionContext(DeclContext *DC, ParameterList *paramList);
DefaultArgumentInfo() {