Skip to content

Commit

Permalink
[flow][test] Expose incorrect ordering of callee hint with explicit t…
Browse files Browse the repository at this point in the history
…ype arguments

Summary:
The ordering here is incorrect, since finding a hint for `s` might depend on the annotation. Add a repro test first in this diff.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D55375050

fbshipit-source-id: b6e1866815695fc6ffe7b1f561dc3abb4e424e3b
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Mar 26, 2024
1 parent b043a6a commit 294a607
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/analysis/env_builder/__tests__/name_def_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,16 @@ Dialog.Prop = function(): void {
(2, 9) to (2, 15) =>
(4, 0) to (4, 11) |}]

let%expect_test "callee hint type args" =
print_order_test {|
generic_fn<annot>((s) => s);
type annot = string;
|};
[%expect {|
(2, 19) to (2, 20) =>
(3, 5) to (3, 10) =>
(2, 18) to (2, 26) (Env_api.Make.ExpressionLoc) |}]

let%expect_test "callee hint cycle" =
print_order_test {|
g(function h() { return f() })
Expand Down

0 comments on commit 294a607

Please sign in to comment.