Revert to printing types as 'nonrec' to avoid a bug
See: https://github.com/ocaml/ocaml/issues/9828master
parent
aa06fa819e
commit
27f1012bc6
|
@ -10,19 +10,19 @@ type t = T of t;;
|
|||
type t = T of t
|
||||
|}]
|
||||
#show t;;
|
||||
(* this output is CORRECT, it does not use nonrec *)
|
||||
(* this output is INCORRECT, it should not use nonrec *)
|
||||
[%%expect{|
|
||||
type t = T of t
|
||||
type nonrec t = T of t
|
||||
|}];;
|
||||
|
||||
type nonrec t = Foo of t;;
|
||||
type nonrec s = Foo of t;;
|
||||
[%%expect{|
|
||||
type nonrec t = Foo of t
|
||||
type nonrec s = Foo of t
|
||||
|}];;
|
||||
#show t;;
|
||||
(* this output in INCORRECT, it should use nonrec *)
|
||||
#show s;;
|
||||
(* this output is CORRECT, it uses nonrec *)
|
||||
[%%expect{|
|
||||
type t = Foo of t
|
||||
type nonrec s = Foo of t
|
||||
|}];;
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ type 'a option = None | Some of 'a
|
|||
|
||||
#show option;;
|
||||
[%%expect {|
|
||||
type 'a option = None | Some of 'a
|
||||
type nonrec 'a option = None | Some of 'a
|
||||
|}];;
|
||||
|
||||
#show Open_binary;;
|
||||
|
@ -59,7 +59,7 @@ type Stdlib.open_flag =
|
|||
|
||||
#show open_flag;;
|
||||
[%%expect {|
|
||||
type open_flag =
|
||||
type nonrec open_flag =
|
||||
Open_rdonly
|
||||
| Open_wronly
|
||||
| Open_append
|
||||
|
@ -90,7 +90,7 @@ type extensible += B of int
|
|||
|
||||
#show extensible;;
|
||||
[%%expect {|
|
||||
type extensible = ..
|
||||
type nonrec extensible = ..
|
||||
|}];;
|
||||
|
||||
type 'a t = ..;;
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
#show list;;
|
||||
[%%expect {|
|
||||
type 'a list = [] | (::) of 'a * 'a list
|
||||
type nonrec 'a list = [] | (::) of 'a * 'a list
|
||||
|}];;
|
||||
|
||||
type 'a t;;
|
||||
#show t;;
|
||||
[%%expect {|
|
||||
type 'a t
|
||||
type 'a t
|
||||
type nonrec 'a t
|
||||
|}];;
|
||||
|
|
|
@ -556,7 +556,7 @@ let () =
|
|||
reg_show_prim "show_type"
|
||||
(fun env loc id lid ->
|
||||
let _path, desc = Env.lookup_type ~loc lid env in
|
||||
[ Sig_type (id, desc, Trec_first, Exported) ]
|
||||
[ Sig_type (id, desc, Trec_not, Exported) ]
|
||||
)
|
||||
"Print the signature of the corresponding type constructor."
|
||||
|
||||
|
|
Loading…
Reference in New Issue