Fix multiple readonly variadic args in typechecker
commit871679e8c84a5c6feded468a2b8296e64403f7c9
authorJames Wu <jjwu@fb.com>
Mon, 24 Jan 2022 21:11:20 +0000 (24 13:11 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 24 Jan 2022 21:12:53 +0000 (24 13:12 -0800)
tree13f8085bf64433ffd4da7f901a1f5c3a489d9ba2
parent3868029092710a7d0ab1cf6703e9b596896ad43b
Fix multiple readonly variadic args in typechecker

Summary: This fixes a bug with multiple variadic args. For more than the correct number of arguments, we should continuously compare each arg to the variadic arg, not just stop at the first one.

Reviewed By: viratyosin

Differential Revision: D33735263

fbshipit-source-id: 3e9f4ef3c2643e4ef1b11c1e762b101baf61a234
hphp/hack/src/typing/tast_check/readonly_check.ml
hphp/hack/test/typecheck/readonly/variadic_readonly.php
hphp/hack/test/typecheck/readonly/variadic_readonly.php.exp