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: 6555 Reporter: kaustuv Assigned to:@lpw25 Status: resolved (set by @lpw25 on 2016-12-12T16:38:39Z) Resolution: won't fix Priority: normal Severity: feature Version: 4.02.0+beta1 / +rc1 Category: ~DO NOT USE (was: OCaml general) Monitored by:@hcarty
Bug description
This is not particularly useful:
% ocaml
OCaml version 4.02.0
type t = .. ;;
type t = ..
type t += A | B ;;
type t += A | B
#show_type t ;;
type t = ..
It would be more useful as a way to find out what constructor names I have "used up" if all the known constructors for an open variant were shown as well.
This is especially problematic since there is not even a warning currently for:
type t = ..
type t += A
let is_a = function A -> true | _ -> false
(* ... )
type t += A
( ... )
let unexpected = is_a A ( unexpected = false *)
The user has to be extra vigilant not to accidentally reuse a constructor and get apparently nonsensical results.
The text was updated successfully, but these errors were encountered:
It is not clear to me that anything more useful can be done here. You can't really print all the existing constructors of a variant, and even printing only those available in scope would involve a deep search through the entire environment. You could only include those defined at the top-level, but that does not seem particularly useful to me.
It is also not really any different from the fact that the REPL lets you shadow modules, types, etc. which can result in confusion.
One thing that would be useful would be a #show_extension Foo directive (which I'm surprised doesn't already exist) and corresponding support in #show.
This is especially problematic since there is not even a warning currently for ...
This gives an error since 4.03, although obviously not in the REPL.
I'm going to mark this issue as "won't fix", but I won't close it yet to give people a chance to disagree.
Original bug ID: 6555
Reporter: kaustuv
Assigned to: @lpw25
Status: resolved (set by @lpw25 on 2016-12-12T16:38:39Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 4.02.0+beta1 / +rc1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @hcarty
Bug description
This is not particularly useful:
% ocaml
OCaml version 4.02.0
type t = .. ;;
type t = ..
type t += A | B ;;
type t += A | B
#show_type t ;;
type t = ..
It would be more useful as a way to find out what constructor names I have "used up" if all the known constructors for an open variant were shown as well.
This is especially problematic since there is not even a warning currently for:
type t = ..
type t += A
let is_a = function A -> true | _ -> false
(* ... )
type t += A
( ... )
let unexpected = is_a A ( unexpected = false *)
The user has to be extra vigilant not to accidentally reuse a constructor and get apparently nonsensical results.
The text was updated successfully, but these errors were encountered: