@@ -151,8 +151,7 @@ LayoutConstraint Parser::parseLayoutConstraint(Identifier LayoutConstraintID) {
151
151
// / type-simple '!'
152
152
// / type-collection
153
153
// / type-array
154
- ParserResult<TypeRepr> Parser::parseTypeSimple (Diag<> MessageID,
155
- bool HandleCodeCompletion) {
154
+ ParserResult<TypeRepr> Parser::parseTypeSimple (Diag<> MessageID) {
156
155
ParserResult<TypeRepr> ty;
157
156
158
157
if (Tok.is (tok::kw_inout) ||
@@ -175,8 +174,6 @@ ParserResult<TypeRepr> Parser::parseTypeSimple(Diag<> MessageID,
175
174
ty = parseTypeTupleBody ();
176
175
break ;
177
176
case tok::code_complete:
178
- if (!HandleCodeCompletion)
179
- break ;
180
177
if (CodeCompletion)
181
178
CodeCompletion->completeTypeSimpleBeginning ();
182
179
return makeParserCodeCompletionResult<TypeRepr>(
@@ -358,7 +355,6 @@ ParserResult<TypeRepr> Parser::parseSILBoxType(GenericParamList *generics,
358
355
// / type-composition 'async'? 'throws'? '->' type
359
356
// /
360
357
ParserResult<TypeRepr> Parser::parseType (Diag<> MessageID,
361
- bool HandleCodeCompletion,
362
358
bool IsSILFuncDecl) {
363
359
// Start a context for creating type syntax.
364
360
SyntaxParsingContext TypeParsingContext (SyntaxContext,
@@ -404,8 +400,7 @@ ParserResult<TypeRepr> Parser::parseType(Diag<> MessageID,
404
400
return parseSILBoxType (generics, attrs, GenericsScope);
405
401
}
406
402
407
- ParserResult<TypeRepr> ty =
408
- parseTypeSimpleOrComposition (MessageID, HandleCodeCompletion);
403
+ ParserResult<TypeRepr> ty = parseTypeSimpleOrComposition (MessageID);
409
404
if (ty.isNull ())
410
405
return ty;
411
406
auto tyR = ty.get ();
@@ -834,8 +829,7 @@ Parser::parseTypeIdentifier(bool isParsingQualifiedDeclBaseType) {
834
829
// / 'some'? type-simple
835
830
// / type-composition '&' type-simple
836
831
ParserResult<TypeRepr>
837
- Parser::parseTypeSimpleOrComposition (Diag<> MessageID,
838
- bool HandleCodeCompletion) {
832
+ Parser::parseTypeSimpleOrComposition (Diag<> MessageID) {
839
833
SyntaxParsingContext SomeTypeContext (SyntaxContext, SyntaxKind::SomeType);
840
834
// Check for the opaque modifier.
841
835
// This is only semantically allowed in certain contexts, but we parse it
@@ -859,8 +853,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
859
853
860
854
SyntaxParsingContext CompositionContext (SyntaxContext, SyntaxContextKind::Type);
861
855
// Parse the first type
862
- ParserResult<TypeRepr> FirstType = parseTypeSimple (MessageID,
863
- HandleCodeCompletion);
856
+ ParserResult<TypeRepr> FirstType = parseTypeSimple (MessageID);
864
857
if (FirstType.isNull ())
865
858
return FirstType;
866
859
if (!Tok.isContextualPunctuator (" &" )) {
@@ -918,7 +911,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
918
911
919
912
// Parse next type.
920
913
ParserResult<TypeRepr> ty =
921
- parseTypeSimple (diag::expected_identifier_for_type, HandleCodeCompletion );
914
+ parseTypeSimple (diag::expected_identifier_for_type);
922
915
if (ty.hasCodeCompletion ())
923
916
return makeParserCodeCompletionResult<TypeRepr>();
924
917
Status |= ty;
0 commit comments