Fix generation flow unnamed computed property (#7095)

This commit is contained in:
Bogdan Chadkin 2017-12-22 21:55:40 +03:00 committed by Brian Ng
parent 035286a810
commit d25918aa5d
3 changed files with 13 additions and 3 deletions

View File

@ -420,9 +420,11 @@ export function ObjectTypeIndexer(node: Object) {
}
this._variance(node);
this.token("[");
this.print(node.id, node);
this.token(":");
this.space();
if (node.id) {
this.print(node.id, node);
this.token(":");
this.space();
}
this.print(node.key, node);
this.token("]");
this.token(":");

View File

@ -7,3 +7,5 @@ type T = { ...U, p: V, };
type T = { ...{}|{ p: V, }};
type T = { foo(): number }
type T = { foo: () => number }
type T = { [string]: U };
type T = { [param: string]: U };

View File

@ -22,3 +22,9 @@ type T = {
type T = {
foo: () => number
};
type T = {
[string]: U
};
type T = {
[param: string]: U
};