Fix rest parameters with flow type casting (#4636)

Do not skip TypeCastExpressions when finding referenced identifiers as the
type cast contains valid non flow code that we need to visit.
This commit is contained in:
Daniel Tschinder
2016-10-01 18:58:14 +02:00
committed by Henry Zhu
parent fe2b9d73ed
commit 16716ea3de
4 changed files with 21 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ let memberExpressionOptimisationVisitor = {
},
Flow(path) {
// Do not skip TypeCastExpressions as the contain valid non flow code
if (path.isTypeCastExpression()) return;
// don't touch reference in type annotations
path.skip();
},