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
Original bug ID: 1274 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: John Prevost
Version: 3.05
OS: Windows
Submission from: 208.167.88.80 (208.167.88.80)
I've discovered a fairly serious typechecking bug in 3.05. I'm
also mentioning it on the mailing list so that people are aware.
You can do the following:
type bad = { x : 'a . 'a option ref };;
type bad = { x : 'a. 'a option ref; }
let bv = { x = ref None };;
val bv : bad = {x = {contents = None}}
bv.x := Some 5;;
: unit = ()
let extra_bad = !(bv.x);;
val extra_bad : '_a option = Some
f extra_bad;;
CRASH
It looks like mutable fields are handled correctly and catch that the
value is not, in fact, general enough. But when the mutable field is
part of the value (in this case, part of the ref), the check is not
done.
The text was updated successfully, but these errors were encountered:
Thanks for your report.
This was really a stupid bug: as others in the group already assessed, I just
forgot to check for non-expansiveness when generalizing first-class polymorphic
expressions.
The problem was specific to records: methods are always non-expansive.
This is now fixed (2 lines of code).
Original bug ID: 1274
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: John Prevost
Version: 3.05
OS: Windows
Submission from: 208.167.88.80 (208.167.88.80)
I've discovered a fairly serious typechecking bug in 3.05. I'm
also mentioning it on the mailing list so that people are aware.
You can do the following:
type bad = { x : 'a . 'a option ref };;
type bad = { x : 'a. 'a option ref; }
let bv = { x = ref None };;
val bv : bad = {x = {contents = None}}
bv.x := Some 5;;
let extra_bad = !(bv.x);;
val extra_bad : '_a option = Some
f extra_bad;;
CRASH
It looks like mutable fields are handled correctly and catch that the
value is not, in fact, general enough. But when the mutable field is
part of the value (in this case, part of the ref), the check is not
done.
The text was updated successfully, but these errors were encountered: