Skip to content

Commit 7c185b5

Browse files
Michael Thomasfacebook-github-bot
authored andcommitted
Reinstate unsat for sub dynamic
Summary: There is some special 'postprocessing' of error messages under sound-dynamic which we are currently ignoring under extended reasons. This diff makes the behavior under extended reasons consistent with the legacy case to ensure we have no regression in error messages. Reviewed By: madgen Differential Revision: D63455212 fbshipit-source-id: ce3722e3316ad6f34e351770c6da6a4986eef859
1 parent e93d6e4 commit 7c185b5

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

hphp/hack/src/typing/typing_subtype.ml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4070,21 +4070,17 @@ end = struct
40704070
and ty_name = lazy (Pretty.describe_ty_default env (LoclType ty_sub))
40714071
and pos = Reason.to_pos (get_reason ty_sub) in
40724072
let postprocess =
4073-
if TypecheckerOptions.using_extended_reasons env.genv.tcopt then
4074-
fun prop ->
4075-
prop
4076-
else
4077-
if_unsat
4078-
(invalid
4079-
~fail:
4080-
(Option.map
4081-
subtype_env.Subtype_env.on_error
4082-
~f:
4083-
Typing_error.(
4084-
fun on_error ->
4085-
apply_reasons ~on_error
4086-
@@ Secondary.Not_sub_dynamic
4087-
{ pos; ty_name; dynamic_part })))
4073+
if_unsat
4074+
(invalid
4075+
~fail:
4076+
(Option.map
4077+
subtype_env.Subtype_env.on_error
4078+
~f:
4079+
Typing_error.(
4080+
fun on_error ->
4081+
apply_reasons ~on_error
4082+
@@ Secondary.Not_sub_dynamic
4083+
{ pos; ty_name; dynamic_part })))
40884084
in
40894085
postprocess
40904086
@@

0 commit comments

Comments
 (0)