File tree 5 files changed +39
-4
lines changed
5 files changed +39
-4
lines changed Original file line number Diff line number Diff line change
1
+
2
+ [1;31mWe've found a bug for you![0m
3
+ [36m/.../fixtures/type2.res[0m:[2m6:11-13[0m
4
+
5
+ 4 [2m│[0m let () = {
6
+ 5 [2m│[0m push(a, 3)->ignore
7
+ [1;31m6[0m [2m│[0m push(a, [1;31m"3"[0m)->ignore
8
+ 7 [2m│[0m }
9
+ 8 [2m│[0m
10
+
11
+ This has type: [1;31mstring[0m
12
+ Somewhere wanted: [1;33mint[0m
13
+
14
+ You can convert [1;33mstring[0m to [1;33mint[0m with [1;33mBelt.Int.fromString[0m.
Original file line number Diff line number Diff line change
1
+
2
+ [1;31mWe've found a bug for you![0m
3
+ [36m/.../fixtures/type3.res[0m:[2m1:5[0m
4
+
5
+ [1;31m1[0m [2m│[0m let [1;31mu[0m = []
6
+ 2 [2m│[0m
7
+
8
+ This expression's type contains type variables that cannot be generalized:
9
+ [1;31marray<'_weak1>[0m
10
+
11
+ This happens when the type system senses there's a mutation/side-effect,
12
+ in combination with a polymorphic value.
13
+ [1;33mUsing or annotating that value usually solves it.[0m
Original file line number Diff line number Diff line change
1
+ @send external push : (array <'a >, 'a ) => unit = "push"
2
+
3
+ let a = []
4
+ let () = {
5
+ push (a , 3 )-> ignore
6
+ push (a , "3" )-> ignore
7
+ }
Original file line number Diff line number Diff line change
1
+ let u = []
Original file line number Diff line number Diff line change @@ -276,14 +276,14 @@ let rec y = A y;;
276
276
OUnit .assert_bool __LOC__
277
277
(Ext_string .contain_substring should_err .stderr "contravariant" )
278
278
end;
279
- __LOC__ > :: begin fun _ ->
279
+ (* __LOC__ >:: begin fun _ ->
280
280
let should_err = bsc_check_eval {|
281
281
let u = [||]
282
282
|} in
283
283
OUnit.assert_bool __LOC__
284
284
(Ext_string.contain_substring should_err.stderr "cannot be generalized")
285
- end;
286
- __LOC__ > :: begin fun _ ->
285
+ end; *)
286
+ (* __LOC__ >:: begin fun _ ->
287
287
let should_err = bsc_check_eval {|
288
288
external push : 'a array -> 'a -> unit = "push" [@@send]
289
289
let a = [||]
@@ -293,7 +293,7 @@ let () =
293
293
|} in
294
294
OUnit.assert_bool __LOC__
295
295
(Ext_string.contain_substring should_err.stderr "string")
296
- end
296
+ end *)
297
297
(* __LOC__ >:: begin fun _ -> *)
298
298
(* let should_infer = perform_bsc [| "-i"; "-bs-eval"|] {| *)
299
299
(* let f = fun [@bs] x -> let (a,b) = x in a + b *)
You can’t perform that action at this time.
0 commit comments