Skip to content

Commit

Permalink
Don't lose monomorph when binding to Null<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Aug 30, 2024
1 parent 3b050f0 commit 9fc0dbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typing/typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ let rec type_ident_raise ctx i p mode with_type =
| TMono r when not (is_nullable t) ->
(* If our expected type is a monomorph, bind it to Null<?>. The is_nullable check is here because
the expected type could already be Null<?>, in which case we don't want to double-wrap (issue #11286). *)
Monomorph.do_bind r (tnull())
Monomorph.bind r (tnull())
| _ ->
(* Otherwise there's no need to create a monomorph, we can just type the null literal
the way we expect it. *)
Expand Down

0 comments on commit 9fc0dbb

Please sign in to comment.