Skip to content

Commit

Permalink
drop other OCaml DS modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Sep 8, 2024
1 parent 2d26286 commit 3fe91d0
Show file tree
Hide file tree
Showing 164 changed files with 1,225 additions and 34,470 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

We've found a bug for you!
/.../fixtures/modules2.res:1:9-14
/.../fixtures/modules2.res:1:9-19

1 │ let b = List.b
1 │ let b = Belt.List.b
2 │

The value b can't be found in List
The value b can't be found in Belt.List
17 changes: 10 additions & 7 deletions jscomp/build_tests/super_errors/expected/primitives7.res.expected
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@

We've found a bug for you!
/.../fixtures/primitives7.res:3:24
/.../fixtures/primitives7.res:3:23

1 │ /* Wanted list(float), found list(int) */
2 │ let a = list{1, 2, 3}
3 │ List.map(n => n +. 2., a)
3 │ a->Belt.List.map(n => n +. 2.)
4 │

This has type: list<int>
But this function argument is expecting: list<float>

The incompatible parts:
int vs float
This has type: int
But it's being used with the +. operator, which works on: float

Floats and ints have their own mathematical operators. This means you cannot add a float and an int without converting between the two.

Possible solutions:
- Ensure all values in this calculation has the type float. You can convert between floats and ints via Belt.Float.toInt and Belt.Int.fromFloat.
- Change the operator to +, which works on int

You can convert int to float with Belt.Int.toFloat.
If this is a literal, try a number with a trailing dot (e.g. 20.).
2 changes: 1 addition & 1 deletion jscomp/build_tests/super_errors/fixtures/modules2.res
Original file line number Diff line number Diff line change
@@ -1 +1 @@
let b = List.b
let b = Belt.List.b
2 changes: 1 addition & 1 deletion jscomp/build_tests/super_errors/fixtures/primitives7.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* Wanted list(float), found list(int) */
let a = list{1, 2, 3}
List.map(n => n +. 2., a)
a->Belt.List.map(n => n +. 2.)
112 changes: 0 additions & 112 deletions jscomp/stdlib-406/complex.res

This file was deleted.

86 changes: 0 additions & 86 deletions jscomp/stdlib-406/complex.resi

This file was deleted.

Loading

0 comments on commit 3fe91d0

Please sign in to comment.