commit
10a8cd9122
|
@ -1331,7 +1331,7 @@ function genericPrintNoParens(path, options, print) {
|
|||
return concat([
|
||||
path.call(print, "name"),
|
||||
n.optional ? "?" : "",
|
||||
": ",
|
||||
n.name ? ": " : "",
|
||||
path.call(print, "typeAnnotation")
|
||||
]);
|
||||
case "GenericTypeAnnotation":
|
||||
|
@ -1421,7 +1421,7 @@ function genericPrintNoParens(path, options, print) {
|
|||
variance,
|
||||
"[",
|
||||
path.call(print, "id"),
|
||||
": ",
|
||||
n.id ? ": " : "",
|
||||
path.call(print, "key"),
|
||||
"]: ",
|
||||
path.call(print, "value")
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
exports[`test optional-type-name.js 1`] = `
|
||||
"type Foo = (any) => string
|
||||
|
||||
type Bar = { [string]: number }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type Foo = (any) => string;
|
||||
|
||||
type Bar = { [string]: number };"
|
||||
`;
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname);
|
|
@ -0,0 +1,3 @@
|
|||
type Foo = (any) => string
|
||||
|
||||
type Bar = { [string]: number }
|
Loading…
Reference in New Issue