Skip to content

Commit

Permalink
Flow: Remove unnecessary type annotations (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jul 11, 2019
1 parent 17990cb commit ef28874
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/language/parser.js
Expand Up @@ -33,8 +33,6 @@ import {
type DirectiveNode,
type TypeNode,
type NamedTypeNode,
type ListTypeNode,
type NonNullTypeNode,
type TypeSystemDefinitionNode,
type SchemaDefinitionNode,
type OperationTypeDefinitionNode,
Expand Down Expand Up @@ -709,20 +707,21 @@ function parseTypeReference(lexer: Lexer<*>): TypeNode {
if (expectOptionalToken(lexer, TokenKind.BRACKET_L)) {
type = parseTypeReference(lexer);
expectToken(lexer, TokenKind.BRACKET_R);
type = ({
type = {
kind: Kind.LIST_TYPE,
type,
loc: loc(lexer, start),
}: ListTypeNode);
};
} else {
type = parseNamedType(lexer);
}

if (expectOptionalToken(lexer, TokenKind.BANG)) {
return ({
return {
kind: Kind.NON_NULL_TYPE,
type,
loc: loc(lexer, start),
}: NonNullTypeNode);
};
}
return type;
}
Expand Down

0 comments on commit ef28874

Please sign in to comment.