Fix variance location (#2261)

Turns out when we refactored for TS, we moved it before "static" and it no longer parses. Oops.
master
Christopher Chedeau 2017-06-24 18:46:29 -07:00 committed by Lucas Azzola
parent 38d4661ba9
commit f71fcd0b65
4 changed files with 20 additions and 4 deletions

View File

@ -1725,10 +1725,6 @@ function genericPrintNoParens(path, options, print, args) {
return concat(parts);
case "ClassProperty":
case "TSAbstractClassProperty": {
const variance = getFlowVariance(n);
if (variance) {
parts.push(variance);
}
if (n.accessibility) {
parts.push(n.accessibility + " ");
}
@ -1741,6 +1737,10 @@ function genericPrintNoParens(path, options, print, args) {
if (n.readonly) {
parts.push("readonly ");
}
const variance = getFlowVariance(n);
if (variance) {
parts.push(variance);
}
if (n.computed) {
parts.push("[", path.call(print, "key"), "]");
} else {

View File

@ -0,0 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`variance.js 1`] = `
class Route {
static +param: T;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Route {
static +param: T;
}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, null, ["babylon"]);

View File

@ -0,0 +1,3 @@
class Route {
static +param: T;
}