Skip to content

Commit

Permalink
Accept new output, clearing a few CRs
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfirere committed Nov 29, 2024
1 parent de00dee commit a0096f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 37 deletions.
30 changes: 5 additions & 25 deletions testsuite/tests/typing-modal-kinds/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -280,22 +280,14 @@ val int_duplicate : int = 5

let string_list_duplicate = let once_ x : string list = ["hi";"bye"] in Fun.id x

(* CR layouts v2.8: this should succeed *)
[%%expect{|
Line 1, characters 79-80:
1 | let string_list_duplicate = let once_ x : string list = ["hi";"bye"] in Fun.id x
^
Error: This value is "once" but expected to be "many".
val string_list_duplicate : string list = ["hi"; "bye"]
|}]

let int_list_duplicate = let once_ x : int list = [4;5] in Fun.id x

(* CR layouts v2.8: this should succeed *)
[%%expect{|
Line 1, characters 66-67:
1 | let int_list_duplicate = let once_ x : int list = [4;5] in Fun.id x
^
Error: This value is "once" but expected to be "many".
val int_list_duplicate : int list = [4; 5]
|}]

let hidden_string_duplicate =
Expand Down Expand Up @@ -332,12 +324,8 @@ let hidden_int_list_duplicate =
[Hidden_int.hide 2; Hidden_int.hide 3]
in Fun.id x

(* CR layouts v2.8: this should succeed *)
[%%expect{|
Line 4, characters 12-13:
4 | in Fun.id x
^
Error: This value is "once" but expected to be "many".
val hidden_int_list_duplicate : Hidden_int.t list = [<abstr>; <abstr>]
|}]

let float_duplicate = let once_ x : float = 3.14 in Fun.id x
Expand Down Expand Up @@ -375,23 +363,15 @@ val hidden_int64_u_duplicate : unit -> Hidden_int64_u.t = <fun>
let float_u_record_duplicate =
let once_ x : float_u_record = { x = #3.14; y = #2.718 } in Fun.id x

(* CR layouts v2.8: this should succeed *)
[%%expect{|
Line 2, characters 69-70:
2 | let once_ x : float_u_record = { x = #3.14; y = #2.718 } in Fun.id x
^
Error: This value is "once" but expected to be "many".
val float_u_record_duplicate : float_u_record = {x = <abstr>; y = <abstr>}
|}]

let float_u_record_list_duplicate =
let once_ x : float_u_record list = [] in Fun.id x

(* CR layouts v2.8: this should succeed *)
[%%expect{|
Line 2, characters 51-52:
2 | let once_ x : float_u_record list = [] in Fun.id x
^
Error: This value is "once" but expected to be "many".
val float_u_record_list_duplicate : float_u_record list = []
|}]

let function_duplicate = let once_ x : int -> int = fun y -> y in Fun.id x
Expand Down
17 changes: 5 additions & 12 deletions testsuite/tests/typing-modal-kinds/expected_mode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ Error: This value is "once" but expected to be "many".
let int_list_duplicate : once_ _ -> int list = fun x -> x

[%%expect{|
Line 1, characters 56-57:
1 | let int_list_duplicate : once_ _ -> int list = fun x -> x
^
Error: This value is "once" but expected to be "many".
val int_list_duplicate : int list @ once -> int list = <fun>
|}]

let hidden_string_duplicate : once_ _ -> Hidden_string.t =
Expand Down Expand Up @@ -268,21 +265,17 @@ let float_u_record_duplicate : once_ _ -> float_u_record =
fun x -> x

[%%expect{|
Line 2, characters 11-12:
2 | fun x -> x
^
Error: This value is "once" but expected to be "many".
val float_u_record_duplicate : float_u_record @ once -> float_u_record =
<fun>
|}]

let float_u_record_list_duplicate :
once_ _ -> float_u_record list =
fun x -> x

[%%expect{|
Line 3, characters 11-12:
3 | fun x -> x
^
Error: This value is "once" but expected to be "many".
val float_u_record_list_duplicate :
float_u_record list @ once -> float_u_record list = <fun>
|}]

let function_duplicate : once_ _ -> (int -> int) = fun x -> x
Expand Down

0 comments on commit a0096f3

Please sign in to comment.