@@ -2930,10 +2930,10 @@ ParserResult<IfConfigDecl> Parser::parseDeclIfConfig(ParseDeclOptions Flags) {
2930
2930
// /
2931
2931
// / \verbatim
2932
2932
// / decl-typealias:
2933
- // / 'typealias' identifier generic-params? '=' type requirement-clause?
2933
+ // / 'typealias' identifier generic-params? '=' type
2934
2934
// / \endverbatim
2935
- ParserResult<TypeDecl> Parser::
2936
- parseDeclTypeAlias (Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
2935
+ ParserResult<TypeDecl> Parser::parseDeclTypeAlias (Parser::ParseDeclOptions Flags,
2936
+ DeclAttributes &Attributes) {
2937
2937
ParserPosition startPosition = getParserPosition ();
2938
2938
SourceLoc TypeAliasLoc = consumeToken (tok::kw_typealias);
2939
2939
Identifier Id;
@@ -2991,13 +2991,6 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
2991
2991
if (UnderlyingTy.isNull ())
2992
2992
return Status;
2993
2993
2994
- // Parse a 'where' clause if present, adding it to our GenericParamList.
2995
- if (Tok.is (tok::kw_where)) {
2996
- auto whereStatus = parseFreestandingGenericWhereClause (genericParams);
2997
- if (whereStatus.shouldStopParsing ())
2998
- return whereStatus;
2999
- }
3000
-
3001
2994
auto *TAD = new (Context) TypeAliasDecl (TypeAliasLoc, Id, IdLoc,
3002
2995
UnderlyingTy.getPtrOrNull (),
3003
2996
genericParams, CurDeclContext);
@@ -4415,8 +4408,7 @@ void Parser::consumeAbstractFunctionBody(AbstractFunctionDecl *AFD,
4415
4408
// / \verbatim
4416
4409
// / decl-func:
4417
4410
// / attribute-list? ('static' | 'class')? 'mutating'? 'func'
4418
- // / any-identifier generic-params? func-signature where-clause?
4419
- // / stmt-brace?
4411
+ // / any-identifier generic-params? func-signature stmt-brace?
4420
4412
// / \endverbatim
4421
4413
// /
4422
4414
// / \note The caller of this method must ensure that the next token is 'func'.
@@ -4565,13 +4557,6 @@ Parser::parseDeclFunc(SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
4565
4557
return SignatureStatus;
4566
4558
}
4567
4559
4568
- // Parse a 'where' clause if present, adding it to our GenericParamList.
4569
- if (Tok.is (tok::kw_where)) {
4570
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
4571
- if (whereStatus.shouldStopParsing ())
4572
- return whereStatus;
4573
- }
4574
-
4575
4560
// Protocol method arguments may not have default values.
4576
4561
if (Flags.contains (PD_InProtocol) && DefaultArgs.HasDefaultArgument ) {
4577
4562
diagnose (FuncLoc, diag::protocol_method_argument_init);
@@ -4701,7 +4686,7 @@ bool Parser::parseAbstractFunctionBodyDelayed(AbstractFunctionDecl *AFD) {
4701
4686
// / \verbatim
4702
4687
// / decl-enum:
4703
4688
// / 'enum' attribute-list identifier generic-params? inheritance?
4704
- // / where-clause? '{' decl-enum-body '}'
4689
+ // / '{' decl-enum-body '}'
4705
4690
// / decl-enum-body:
4706
4691
// / decl*
4707
4692
// / \endverbatim
@@ -4744,14 +4729,6 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
4744
4729
Status |= parseInheritance (Inherited, /* classRequirementLoc=*/ nullptr );
4745
4730
UD->setInherited (Context.AllocateCopy (Inherited));
4746
4731
}
4747
-
4748
- // Parse a 'where' clause if present, adding it to our GenericParamList.
4749
- if (Tok.is (tok::kw_where)) {
4750
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
4751
- if (whereStatus.shouldStopParsing ())
4752
- return whereStatus;
4753
- UD->setGenericParams (GenericParams);
4754
- }
4755
4732
4756
4733
SourceLoc LBLoc, RBLoc;
4757
4734
if (parseToken (tok::l_brace, LBLoc, diag::expected_lbrace_enum)) {
@@ -4989,7 +4966,7 @@ bool Parser::parseNominalDeclMembers(SourceLoc LBLoc, SourceLoc &RBLoc,
4989
4966
// / \verbatim
4990
4967
// / decl-struct:
4991
4968
// / 'struct' attribute-list identifier generic-params? inheritance?
4992
- // / where-clause? '{' decl-struct-body '}
4969
+ // / '{' decl-struct-body '}
4993
4970
// / decl-struct-body:
4994
4971
// / decl*
4995
4972
// / \endverbatim
@@ -5035,14 +5012,6 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
5035
5012
Status |= parseInheritance (Inherited, /* classRequirementLoc=*/ nullptr );
5036
5013
SD->setInherited (Context.AllocateCopy (Inherited));
5037
5014
}
5038
-
5039
- // Parse a 'where' clause if present, adding it to our GenericParamList.
5040
- if (Tok.is (tok::kw_where)) {
5041
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
5042
- if (whereStatus.shouldStopParsing ())
5043
- return whereStatus;
5044
- SD->setGenericParams (GenericParams);
5045
- }
5046
5015
5047
5016
SourceLoc LBLoc, RBLoc;
5048
5017
if (parseToken (tok::l_brace, LBLoc, diag::expected_lbrace_struct)) {
@@ -5078,7 +5047,7 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
5078
5047
// / \verbatim
5079
5048
// / decl-class:
5080
5049
// / 'class' attribute-list identifier generic-params? inheritance?
5081
- // / where-clause? '{' decl-class-body '}
5050
+ // / '{' decl-class-body '}
5082
5051
// / decl-class-body:
5083
5052
// / decl*
5084
5053
// / \endverbatim
@@ -5124,14 +5093,6 @@ ParserResult<ClassDecl> Parser::parseDeclClass(SourceLoc ClassLoc,
5124
5093
CD->setInherited (Context.AllocateCopy (Inherited));
5125
5094
}
5126
5095
5127
- // Parse a 'where' clause if present, adding it to our GenericParamList.
5128
- if (Tok.is (tok::kw_where)) {
5129
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
5130
- if (whereStatus.shouldStopParsing ())
5131
- return whereStatus;
5132
- CD->setGenericParams (GenericParams);
5133
- }
5134
-
5135
5096
SourceLoc LBLoc, RBLoc;
5136
5097
if (parseToken (tok::l_brace, LBLoc, diag::expected_lbrace_class)) {
5137
5098
LBLoc = PreviousLoc;
@@ -5415,13 +5376,6 @@ Parser::parseDeclInit(ParseDeclOptions Flags, DeclAttributes &Attributes) {
5415
5376
Attributes.add (new (Context) RethrowsAttr (throwsLoc));
5416
5377
}
5417
5378
5418
- // Parse a 'where' clause if present, adding it to our GenericParamList.
5419
- if (Tok.is (tok::kw_where)) {
5420
- auto whereStatus = parseFreestandingGenericWhereClause (GenericParams);
5421
- if (whereStatus.shouldStopParsing ())
5422
- return whereStatus;
5423
- }
5424
-
5425
5379
auto *SelfDecl = ParamDecl::createUnboundSelf (ConstructorLoc, CurDeclContext);
5426
5380
5427
5381
Scope S2 (this , ScopeKind::ConstructorBody);
0 commit comments