output type annotations of type instantiation parameters - fixes #2036

This commit is contained in:
Sebastian McKenzie 2015-07-20 00:20:40 +01:00
parent 3a74f6d4cc
commit a523f60209
3 changed files with 8 additions and 1 deletions

View File

@ -252,7 +252,12 @@ export function TypeAnnotation(node, print) {
export function TypeParameterInstantiation(node, print) {
this.push("<");
print.join(node.params, { separator: ", " });
print.join(node.params, {
separator: ", ",
iterator(node) {
print.plain(node.typeAnnotation);
}
});
this.push(">");
}

View File

@ -16,6 +16,7 @@ function foo():(_?:bool) => number{}
function foo(): {} {}
function foo<T>() {}
function foo<T,S>() {}
function foo<T: F>() {}
a = function<T,S>() {};
a = { set fooProp(value: number) {} };
a = { set fooProp(value: number): void {} };

View File

@ -16,6 +16,7 @@ function foo(): (_?: bool) => number {}
function foo(): {} {}
function foo<T>() {}
function foo<T, S>() {}
function foo<T: F>() {}
a = function <T, S>() {};
a = { set fooProp(value: number) {} };
a = { set fooProp(value: number): void {} };