Skip to content

Commit 920a23f

Browse files
committed
---
yaml --- r: 341965 b: refs/heads/rxwei-patch-1 c: 2cfe8ad h: refs/heads/master i: 341963: f303441
1 parent 202ed2b commit 920a23f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: d82dd84592c05655faa3e1e8fde3d6b038a59225
1018+
refs/heads/rxwei-patch-1: 2cfe8ad52a0f2162808381101b6b80cb75a2b118
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/lib/Parse/ParsePattern.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ void Parser::DefaultArgumentInfo::setFunctionContext(
6767
static ParserStatus parseDefaultArgument(
6868
Parser &P, Parser::DefaultArgumentInfo *defaultArgs, unsigned argIndex,
6969
Expr *&init, bool &hasInheritedDefaultArg,
70-
Parser::ParameterContextKind paramContext, tok assignmentTok) {
70+
Parser::ParameterContextKind paramContext) {
7171
SyntaxParsingContext DefaultArgContext(P.SyntaxContext,
7272
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();
7476

7577
if (P.SF.Kind == SourceFileKind::Interface) {
7678
// Swift module interfaces don't synthesize inherited intializers and
@@ -394,7 +396,7 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
394396

395397
status |= parseDefaultArgument(
396398
*this, defaultArgs, defaultArgIndex, param.DefaultArg,
397-
param.hasInheritedDefaultArg, paramContext, Tok.getKind());
399+
param.hasInheritedDefaultArg, paramContext);
398400

399401
if (param.EllipsisLoc.isValid() && param.DefaultArg) {
400402
// The range of the complete default argument.

0 commit comments

Comments
 (0)