Skip to content

Commit 972b44a

Browse files
panagosg7facebook-github-bot
authored andcommitted
[flow] relax recursively_resolvable check
Summary: In upcoming changes we will be attaching hints to identifiers to help determine whether we need to generalize types or not (see D66659579 for definitions). This change would cause some new [definition-cycle] and [recursive-definition] errors, due to `recursively_resolvable` considering, since expression when `chain` is `true` as non-resolvable. I can't think of a reason why this should be the case, so this diff changes `recursively_resolvable` on `ExpressionDef` to descend into expressions even if there is a hint and when `chain` is `true`. The latter is typically the case when we have a `Member` expression. `expression_resolvable` handles the case of `Member`, so this should also be okay. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D69557697 fbshipit-source-id: 3853e611240c6d63a0d6701f0f116a09e1c2b8c5
1 parent a2c50b2 commit 972b44a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/analysis/env_builder/name_def_ordering.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,8 @@ struct
12441244
in
12451245
function
12461246
| Binding bind -> bind_loop bind
1247-
| ExpressionDef { hints = []; expr; chain = false; _ } -> expression_resolvable expr
1247+
| ExpressionDef { hints = []; expr; chain = _; cond_context = _ } ->
1248+
expression_resolvable expr
12481249
| GeneratorNext _
12491250
| TypeAlias _
12501251
| OpaqueType _

0 commit comments

Comments
 (0)