@@ -67,10 +67,12 @@ void Parser::DefaultArgumentInfo::setFunctionContext(
67
67
static ParserStatus parseDefaultArgument (
68
68
Parser &P, Parser::DefaultArgumentInfo *defaultArgs, unsigned argIndex,
69
69
Expr *&init, bool &hasInheritedDefaultArg,
70
- Parser::ParameterContextKind paramContext, tok assignmentTok ) {
70
+ Parser::ParameterContextKind paramContext) {
71
71
SyntaxParsingContext DefaultArgContext (P.SyntaxContext ,
72
72
SyntaxKind::InitializerClause);
73
- SourceLoc equalLoc = P.consumeToken (assignmentTok);
73
+ assert (P.Tok .is (tok::equal) ||
74
+ (P.Tok .isBinaryOperator () && P.Tok .getText () == " ==" ));
75
+ SourceLoc equalLoc = P.consumeToken ();
74
76
75
77
if (P.SF .Kind == SourceFileKind::Interface) {
76
78
// Swift module interfaces don't synthesize inherited intializers and
@@ -394,7 +396,7 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
394
396
395
397
status |= parseDefaultArgument (
396
398
*this , defaultArgs, defaultArgIndex, param.DefaultArg ,
397
- param.hasInheritedDefaultArg , paramContext, Tok. getKind () );
399
+ param.hasInheritedDefaultArg , paramContext);
398
400
399
401
if (param.EllipsisLoc .isValid () && param.DefaultArg ) {
400
402
// The range of the complete default argument.
0 commit comments