You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native toplevel does not retain type var names as the bytecode toplevel does. When a type with type parameters is defined in a native toplevel session, with those parameters explicitly named, future evaluation may not retain this name and use the regular 'a, 'b, etc. instead.
#moduleA : sigtype('foo, 'bar) tvalget_foo : ('foo, _) t -> 'foooptionend=structtype('foo, 'bar) t =
| Fooof'foo
| Barof'barletget_foo=function|Foofoo -> Some foo
|Bar_ -> Noneend
;;
moduleA :
sigtype ('foo, 'bar) t valget_foo : ('foo, 'a) t -> 'foooptionend#A.get_foo;;
- : ('foo, 'a) A.t -> 'foo option=<fun>
This is what you get in a bytecode toplevel, the 'foo type variable is preserved in the toplevel evaluation of A.get_foo. Running the same phrases in a native toplevel would get you:
The native toplevel does not retain type var names as the bytecode toplevel does. When a type with type parameters is defined in a native toplevel session, with those parameters explicitly named, future evaluation may not retain this name and use the regular
'a
,'b
, etc. instead.Here's an example, taken from ocaml-jit's test suite:
This is what you get in a bytecode toplevel, the
'foo
type variable is preserved in the toplevel evaluation ofA.get_foo
. Running the same phrases in a native toplevel would get you:This has been fixed in ocaml-flambda/flambda-backend#188.
The upstream patch is awaiting review here ocaml/ocaml#10712.
The text was updated successfully, but these errors were encountered: