Fix support for Flow's QualifiedTypeIdentifier (#9396)

This commit is contained in:
Brian Ng 2019-01-23 15:19:17 -06:00 committed by GitHub
parent 8bc9f9a05f
commit d4e045ac24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,4 @@
type A = interface { p: string }; type A = interface { p: string };
type B = interface extends X { p: string }; type B = interface extends X { p: string };
type C = interface extends X, Y { p: string }; type C = interface extends X, Y { p: string };
type D = interface extends X.Y<Z> { p: string };

View File

@ -7,3 +7,6 @@ type B = interface extends X {
type C = interface extends X, Y { type C = interface extends X, Y {
p: string p: string
}; };
type D = interface extends X.Y<Z> {
p: string
};

View File

@ -14,3 +14,5 @@ type overloads =
; ;
type func = string => string; type func = string => string;
type D = X.Y<Z>;

View File

@ -9,3 +9,4 @@ type union = {
}; };
type overloads = (x: string) => number & (x: number) => string; type overloads = (x: string) => number & (x: number) => string;
type func = (string) => string; type func = (string) => string;
type D = X.Y<Z>;

View File

@ -191,7 +191,7 @@ defineType("GenericTypeAnnotation", {
visitor: ["id", "typeParameters"], visitor: ["id", "typeParameters"],
aliases: ["Flow", "FlowType"], aliases: ["Flow", "FlowType"],
fields: { fields: {
id: validateType("Identifier"), id: validateType(["Identifier", "QualifiedTypeIdentifier"]),
typeParameters: validateOptionalType("TypeParameterInstantiation"), typeParameters: validateOptionalType("TypeParameterInstantiation"),
}, },
}); });
@ -204,7 +204,7 @@ defineType("InterfaceExtends", {
visitor: ["id", "typeParameters"], visitor: ["id", "typeParameters"],
aliases: ["Flow"], aliases: ["Flow"],
fields: { fields: {
id: validateType("Identifier"), id: validateType(["Identifier", "QualifiedTypeIdentifier"]),
typeParameters: validateOptionalType("TypeParameterInstantiation"), typeParameters: validateOptionalType("TypeParameterInstantiation"),
}, },
}); });