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: 5447 Reporter: pilki Assigned to:@garrigue Status: closed (set by @garrigue on 2011-12-24T03:21:52Z) Resolution: not a bug Severity: feature Category: ~DO NOT USE (was: OCaml general) Related to:#5448 Child of:#5444 Monitored by:@protz
Bug description
Say you have
<<<
type ('fst, 'snd) mypair = MkMyPair of 'fst * 'snd
let myfst (MkMyPair (x, _): ('fst, 'snd) mypair) = x
let foo x = myfst x + 1
The inferred types are:
<<<
type ('fst, 'snd) mypair = MkMyPair of 'fst * 'snd
val myfst : ('fst, 'snd) mypair -> 'fst
val foo : (int, 'a) mypair -> int
One might have expected
val foo: (int, 'snd) mypair -> int
The text was updated successfully, but these errors were encountered:
As mentioned in #5445, names are forgotten upon instantiation.
It is not clear to me how useful it would be to inherit them in other types.
At the very least, we would need two categories of names: explicit names
(given by the user in the function) and inherited names, with a priority
to explicit names.
If deemed useful, would need to experiment with several policies.
Original bug ID: 5447
Reporter: pilki
Assigned to: @garrigue
Status: closed (set by @garrigue on 2011-12-24T03:21:52Z)
Resolution: not a bug
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Related to: #5448
Child of: #5444
Monitored by: @protz
Bug description
Say you have
<<<
type ('fst, 'snd) mypair = MkMyPair of 'fst * 'snd
let myfst (MkMyPair (x, _): ('fst, 'snd) mypair) = x
let foo x = myfst x + 1
The inferred types are:
<<<
type ('fst, 'snd) mypair = MkMyPair of 'fst * 'snd
val myfst : ('fst, 'snd) mypair -> 'fst
val foo : (int, 'a) mypair -> int
One might have expected
val foo: (int, 'snd) mypair -> int
The text was updated successfully, but these errors were encountered: