diff --git a/packages/flow-remove-types/index.js b/packages/flow-remove-types/index.js index 53fe4fa35af..86521073962 100644 --- a/packages/flow-remove-types/index.js +++ b/packages/flow-remove-types/index.js @@ -168,7 +168,11 @@ var removeFlowVisitor = { AsExpression: function (context, node, ast) { var typeIdx = findTokenIndexAtStartOfNode(ast.tokens, node.typeAnnotation); removeNode(context, ast.tokens[typeIdx - 1]); // `as` token - removeNode(context, node.typeAnnotation); + if (node.typeAnnotation.type === 'GenericTypeAnnotation') { + removeNode(context, ast.tokens[typeIdx]); + } else { + removeNode(context, node.typeAnnotation); + } }, AsConstExpression: function (context, node, ast) { diff --git a/packages/flow-remove-types/test/expected-pretty-inlinemap-stdin.js b/packages/flow-remove-types/test/expected-pretty-inlinemap-stdin.js index 4326ab9bc8e..c8cd8a35380 100644 --- a/packages/flow-remove-types/test/expected-pretty-inlinemap-stdin.js +++ b/packages/flow-remove-types/test/expected-pretty-inlinemap-stdin.js @@ -229,8 +229,15 @@ const kk = function(a,) {} 1; [1]; +// `as` cast with generics +'m'; +['a', 'b', 'c']; +['x', 'y', 'z']; +const ga = {a: 'b'}; +const gb = {a: 'x', b: 1}; + // `as const` 's'; ['s']; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjxzdGRpbj4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkdBQUcsQUFBSzs7Ozs7O0VBTU4sQUFBQSxBQUFhLEFBQUMsQUFBQTtFQUNkLEFBQUEsQUFBcUIsQUFBQTs7OztBQUl2QixBQUE0QyxBQUFBOzs7cUJBR3ZCLEFBQU0sVUFBVSxBQUFBLEFBQUMsaUJBQWlCLEFBQUEsQUFBQyxPQUFPLEFBQUEsQUFBYyxPQUFPLEFBQVE7O2lCQUUzRSxBQUFLOzs7O0FBSXRCLEFBSUMsQUFBQTs7O0FBR0QsQUFFQyxBQUFBOzs7QUFHRCxBQUVDLEFBQUE7Ozt3QkFHdUIsQUFBQSxBQ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+O1xuXG4vLyBgYXMgY29uc3RgXG4ncycgYXMgY29uc3Q7XG5bJ3MnXSBhcyBjb25zdDtcbiJdfQ== diff --git a/packages/flow-remove-types/test/expected-pretty-inlinemap.js b/packages/flow-remove-types/test/expected-pretty-inlinemap.js index 41740045372..baad90d311a 100644 --- a/packages/flow-remove-types/test/expected-pretty-inlinemap.js +++ b/packages/flow-remove-types/test/expected-pretty-inlinemap.js @@ -229,8 +229,15 @@ const kk = function(a,) {} 1; [1]; +// `as` cast with generics +'m'; +['a', 'b', 'c']; +['x', 'y', 'z']; +const ga = {a: 'b'}; +const gb = {a: 'x', b: 1}; + // `as const` 's'; ['s']; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Qvc291cmNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJHQUFHLEFBQUs7Ozs7OztFQU1OLEFBQUEsQUFBYSxBQUFDLEFBQUE7RUFDZCxBQUFBLEFBQXFCLEFBQUE7Ozs7QUFJdkIsQUFBNEMsQUFBQTs7O3FCQUd2QixBQUFNLFVBQVUsQUFBQSxBQUFDLGlCQUFpQixBQUFBLEFBQUMsT0FBTyxBQUFBLEFBQWMsT0FBTyxBQUFROztpQkFFM0UsQUFBSzs7OztBQUl0QixBQUlDLEFBQUE7OztBQUdELEFBRUMsQUFBQTs7O0FBR0QsQUFFQyxBQUFBOzs7d0JBR3VCLEFBQUEsQUFBVSxPQUFPLEFBQUEsQUFBRyxBQUFDLENBQUMsQUFBQSxBQUFVOztRQUVoRCxBQUFROzs7RUFHZCxBQUFBLEFBQUMsU0FBUyxBQUFROzs7TUFHZCxBQUFLOzs7RUFHVCxBQUFBLEFBQUMsTUFBTSxBQUFROztVQUVQLEFBQU87Ozs7OzswQkFNUyxBQUFBLEFBQVUsQ0FBQyxBQUFBLEFBQUc7TUFDbEMsQUFBSzs7VUFFRCxBQUFPOzs7Ozs7YUFNSixBQUFHO09BQ1Q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QUFBLEFBQUMsQUFBQTs7O0VBR0YsQUFBQSxBQUFPLEFBQUMsQUFBQTs7O0VBR1IsQUFBQSxBQUFPLEFBQUMsQUFBQTtHQUNQLEFBQVE7Ozs7RUFJVCxBQUFBLEFBQU8sQUFBQyxBQUFBO0dBQ1AsQUFBUTs7ZUFFSSxBQUFPLEFBQUMsRUFBRSxBQUFROzs7bUJBR2QsQUFBWTttQkFDWixBQUFZLEFBQUM7bUJBQ2IsQUFDWCxBQUFDLEFBQUE7O21CQUVVLEFBQ1gsQUFBQTs7QUFFUixBQUFDO29CQUNtQixBQUNaLEFBQUMsQUFBQTtDQUNSLEFBQVE7OztFQUdQLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBTTtFQUNULEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBTSxDQUFDLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBSztJQUNoQixBQUFBLEFBQUUsQ0FBQyxBQUFBLEFBQUc7OztJQUdOLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBYSxBQUFRO2dCQUNaLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBSyxBQUFtQztnQkFDM0MsQUFBQSxBQUFFLENBQUMsQUFBQSxBQUFPLEFBQTBCO29CQUNoQyxBQUFBLEFBQUUsQ0FBQyxBQUFBLEFBQUssQUFBcUM7MEJBQ3ZDLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBTSxBQUF3Qjs7O0lBR3ZELEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBSztNQUNOLEFBQUEsQUFBRSxDQUFDLEFBQUEsQUFBSyJ9 diff --git a/packages/flow-remove-types/test/expected-pretty.js b/packages/flow-remove-types/test/expected-pretty.js index 24668bd0238..52554353c1f 100644 --- a/packages/flow-remove-types/test/expected-pretty.js +++ b/packages/flow-remove-types/test/expected-pretty.js @@ -229,6 +229,13 @@ const kk = function(a,) {} 1; [1]; +// `as` cast with generics +'m'; +['a', 'b', 'c']; +['x', 'y', 'z']; +const ga = {a: 'b'}; +const gb = {a: 'x', b: 1}; + // `as const` 's'; ['s']; diff --git a/packages/flow-remove-types/test/expected-uninitialized-fields.js b/packages/flow-remove-types/test/expected-uninitialized-fields.js index 67581361179..85b41ba3c1f 100644 --- a/packages/flow-remove-types/test/expected-uninitialized-fields.js +++ b/packages/flow-remove-types/test/expected-uninitialized-fields.js @@ -293,6 +293,13 @@ a ,) {} 1 ; [1] ; +// `as` cast with generics +'m' ; +['a', 'b', 'c'] ; +['x', 'y', 'z'] ; +const ga = {a: 'b'} ; +const gb = {a: 'x', b: 1} ; + // `as const` 's' ; ['s'] ; diff --git a/packages/flow-remove-types/test/expected-with-maps/test/source.js b/packages/flow-remove-types/test/expected-with-maps/test/source.js index bced28283b3..6948219c8ff 100644 --- a/packages/flow-remove-types/test/expected-with-maps/test/source.js +++ b/packages/flow-remove-types/test/expected-with-maps/test/source.js @@ -229,6 +229,13 @@ const kk = function(a,) {} 1; [1]; +// `as` cast with generics +'m'; +['a', 'b', 'c']; +['x', 'y', 'z']; +const ga = {a: 'b'}; +const gb = {a: 'x', b: 1}; + // `as const` 's'; ['s']; diff --git a/packages/flow-remove-types/test/expected-with-maps/test/source.js.map b/packages/flow-remove-types/test/expected-with-maps/test/source.js.map index 3b455eb0703..77b1cecbb4c 100644 --- a/packages/flow-remove-types/test/expected-with-maps/test/source.js.map +++ b/packages/flow-remove-types/test/expected-with-maps/test/source.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../source.js"],"names":[],"mappings":"GAAG,AAAK;;;;;;EAMN,AAAA,AAAa,AAAC,AAAA;EACd,AAAA,AAAqB,AAAA;;;;AAIvB,AAA4C,AAAA;;;qBAGvB,AAAM,UAAU,AAAA,AAAC,iBAAiB,AAAA,AAAC,OAAO,AAAA,AAAc,OAAO,AAAQ;;iBAE3E,AAAK;;;;AAItB,AAIC,AAAA;;;AAGD,AAEC,AAAA;;;AAGD,AAEC,AAAA;;;wBAGuB,AAAA,AAAU,OAAO,AAAA,AA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AAyC,AAAA;AACzC,AAAgC,AAAA;YACpB,AAAa;YACb,AAAa,AAAC;YACd,AAAa;GACtB,AAAA,AAAC;YACQ,AACF,AAAA;;GAEP,AAAA,AAAC;YACQ,AACF,AAAA;;GAEP,AAAA,AAAC,AAAA;;;EAGF,AAAA,AAAO,AAAC,AAAA;;;EAGR,AAAA,AAAO,AAAC,AAAA;GACP,AAAQ;;;;EAIT,AAAA,AAAO,AAAC,AAAA;GACP,AAAQ;;eAEI,AAAO,AAAC,EAAE,AAAQ;;;mBAGd,AAAY;mBACZ,AAAY,AAAC;mBACb,AACX,AAAC,AAAA;;mBAEU,AACX,AAAA;;AAER,AAAC;oBACmB,AACZ,AAAC,AAAA;CACR,AAAQ;;;EAGP,AAAA,AAAE,CAAC,AAAA,AAAM;EACT,AAAA,AAAE,CAAC,AAAA,AAAM,CAAC,AAAA,AAAE,CAAC,AAAA,AAAK;IAChB,AAAA,AAAE,CAAC,AAAA,AAAG;;;IAGN,AAAA,AAAE,CAAC,AAAA,AAAa,AAAQ;gBACZ,AAAA,AAAE,CAAC,AAAA,AAAK,AAAmC;gBAC3C,AAAA,AAAE,CAAC,AAAA,AAAO,AAA0B;oBAChC,AAAA,AAAE,CAAC,AAAA,AAAK,AAAqC;0BACvC,AAAA,AAAE,CAAC,AAAA,AAAM,AAAwB;;;IAGvD,AAAA,AAAE,CAAC,AAAA,AAAK;MACN,AAAA,AAAE,CAAC,AAAA,AAAK"} diff --git a/packages/flow-remove-types/test/expected.js b/packages/flow-remove-types/test/expected.js index 79b7fa20d19..3106501cad0 100644 --- a/packages/flow-remove-types/test/expected.js +++ b/packages/flow-remove-types/test/expected.js @@ -293,6 +293,13 @@ a ,) {} 1 ; [1] ; +// `as` cast with generics +'m' ; +['a', 'b', 'c'] ; +['x', 'y', 'z'] ; +const ga = {a: 'b'} ; +const gb = {a: 'x', b: 1} ; + // `as const` 's' ; ['s'] ; diff --git a/packages/flow-remove-types/test/source.js b/packages/flow-remove-types/test/source.js index afceeb96ea7..ba1d2e86466 100644 --- a/packages/flow-remove-types/test/source.js +++ b/packages/flow-remove-types/test/source.js @@ -293,6 +293,13 @@ a: string,) {} 1 as number as mixed; [1] as [1]; +// `as` cast with generics +'m' as $NonMaybeType; +['a', 'b', 'c'] as $Keys<{a: string, b: string, c: number}>; +['x', 'y', 'z'] as $Values<{a: 'x', b: 'y', c: 'z'}>; +const ga = {a: 'b'} as $Rest<{a: string, c: number}, {c: number}>; +const gb = {a: 'x', b: 1} as $Shape<{a: string, b: number}>; + // `as const` 's' as const; ['s'] as const;