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
moduleW=structlet r =ref (object method m x =Printf.printf "BAD %i\n%!" x end)
endlet proxy =object method m = (!W.r) # m end
let()=W.r :=object method m x =Printf.printf "OK %i\n%!" x end;
proxy # m 3
On 4.12.1 and on trunk, both with ocamlc and ocamlopt, this program prints "BAD 3" instead of "OK 3". A first look at the output of -dlambda suggests that the method m on proxy is compiled using CamlinternalOO's SendConst, reading from the W.r reference when the proxy object is created. This is not correct, because this read is impure.
The text was updated successfully, but these errors were encountered:
On 4.12.1 and on trunk, both with ocamlc and ocamlopt, this program prints "BAD 3" instead of "OK 3". A first look at the output of -dlambda suggests that the method
m
on proxy is compiled using CamlinternalOO'sSendConst
, reading from theW.r
reference when the proxy object is created. This is not correct, because this read is impure.The text was updated successfully, but these errors were encountered: