Add support for flow's SymbolTypeAnnotation (#11077)

This commit is contained in:
Brian Ng
2020-03-16 17:00:17 -05:00
committed by GitHub
parent 2bce1e5e20
commit 4f394e30d2
14 changed files with 291 additions and 2 deletions

View File

@@ -596,6 +596,10 @@ export function QualifiedTypeIdentifier(node: Object) {
this.print(node.id, node);
}
export function SymbolTypeAnnotation() {
this.word("symbol");
}
function orSeparator() {
this.space();
this.token("|");

View File

@@ -23,3 +23,4 @@ declare opaque type Foo<T>: Bar<T>;
declare opaque type ID;
declare opaque type num: number;
declare opaque type NumArray;
declare var sym: symbol;

View File

@@ -41,4 +41,5 @@ declare module.exports: {
declare opaque type Foo<T>: Bar<T>;
declare opaque type ID;
declare opaque type num: number;
declare opaque type NumArray;
declare opaque type NumArray;
declare var sym: symbol;

View File

@@ -128,3 +128,4 @@ var a34: {| id<T>(x: T): T; |};
function foo27(numVal: number = 2) {}
function foo28(numVal?: number = 2) {}
export type * from "foo";
const foo29: symbol = Symbol();

View File

@@ -293,4 +293,5 @@ function foo27(numVal: number = 2) {}
function foo28(numVal?: number = 2) {}
export type * from "foo";
export type * from "foo";
const foo29: symbol = Symbol();