Skip to content
Open
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#### :house: Internal

- Remove `Primitive_option.toUndefined`; use `valFromOption` for optional ffi args. https://github.com/rescript-lang/rescript/pull/8380
- Expand `super_errors` fixture coverage for warnings and errors. https://github.com/rescript-lang/rescript/pull/8429

# 13.0.0-alpha.4

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

We've found a bug for you!
/.../fixtures/apply_wrong_label.res:3:22-28

1 │ let greet = (~name) => "Hello " ++ name
2 │
3 │ let _ = greet(~names="world")
4 │

This function does not take the argument ~names.
This function has type: (~name: string) => string
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

We've found a bug for you!
/.../fixtures/conflicting_ffi_attributes.res:1:1-2:50

1 │ @val @send
2 │ external doThing: (string, int) => int = "doThing"
3 │
4 │ let _ = doThing("x", 1)

Conflicting attributes: Attribute found that conflicts with %@val
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

We've found a bug for you!
/.../fixtures/duplicate_module_in_scope.res:5:8

3 │ }
4 │
5 │ module M = {
6 │ let x = 2
7 │ }

Multiple definition of the module name M
at /.../fixtures/duplicate_module_in_scope.res:1:8
Names must be unique in a given structure or signature.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

We've found a bug for you!
/.../fixtures/duplicate_variant_constructor.res:1:1-18

1 │ type t = Foo | Foo
2 │

Two constructors are named Foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/duplicated_bs_deriving.res:1:22-30

1 │ @deriving(accessors) @deriving(jsConverter)
2 │ type t = One | Two
3 │

duplicate @deriving attribute
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

We've found a bug for you!
/.../fixtures/exception_pattern_below_toplevel.res:3:10-28

1 │ let run = action =>
2 │ switch action() {
3 │ | Some(exception Not_found) => "nested exception pattern is invalid"
4 │ | _ => "ok"
5 │ }

Exception patterns must be at the top level of a match case.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

We've found a bug for you!
/.../fixtures/functor_apply_arg_mismatch.res:13:22-29

11 │ }
12 │
13 │ module Result = Make(Concrete)
14 │ let _ = Result.bar
15 │

Signature mismatch:
Modules do not match: {
let unrelated: string
} is not included in HasFoo
The value `foo' is required but not provided
/.../fixtures/functor_apply_arg_mismatch.res:2:3-14:
Expected declaration
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Warning number 39
/.../fixtures/illegal_letrec_pat.res:1:9-14

1 │ let rec (x, y) = (1, 2)
2 │ let _ = x + y
3 │

unused rec flag.


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

1 │ let rec (x, y) = (1, 2)
2 │ let _ = x + y
3 │

Only variables are allowed as left-hand side of `let rec'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

We've found a bug for you!
/.../fixtures/invalid_type_variable_name.res:1:9-16

1 │ type t<'_invalid> = list<'_invalid>
2 │

The type variable name '_invalid is not allowed in programs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

We've found a bug for you!
/.../fixtures/label_multiply_defined_literal.res:3:19

1 │ type t = {a: int, b: int}
2 │
3 │ let r: t = {a: 1, a: 2, b: 3}
4 │ let _ = r
5 │

The record field label a is defined several times
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/multiply_bound_variable.res:1:9

1 │ let (x, x) = (1, 2)
2 │ let _ = x
3 │

Variable x is bound several times in this matching
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

We've found a bug for you!
/.../fixtures/or_pattern_type_clash.res:3:9-15

1 │ let f = (x: int) =>
2 │ switch x {
3 │ | 1 | "hello" => "weird"
4 │ | _ => "other"
5 │ }

This pattern matches values of type string
but a pattern was expected which matches values of type int
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

We've found a bug for you!
/.../fixtures/orpat_vars_unbalanced.res:3:5-18

1 │ let f = x =>
2 │ switch x {
3 │ | Some(n) | None => n
4 │ | _ => 0
5 │ }

Variable n must occur on both sides of this | pattern
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

We've found a bug for you!
/.../fixtures/record_literal_missing_fields.res:3:12-13

1 │ type t = {a: int}
2 │
3 │ let r: t = {}
4 │

Some required record fields are missing: a.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

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

1 │ type rec t = t
2 │

The type abbreviation t is cyclic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

We've found a bug for you!
/.../fixtures/repeated_type_parameter.res:1:13

1 │ type t<'a, 'a> = ('a, 'a)
2 │

A type parameter occurs several times
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

We've found a bug for you!
/.../fixtures/too_many_arguments.res:3:9-11

1 │ let add = (x, y) => x + y
2 │
3 │ let _ = add(1, 2, 3)
4 │

This function call is incorrect.
The function has type:
(int, int) => int

- The function takes just 2 unlabelled arguments, but is called with 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/type_abbrev_missing_rec.res:1:10

1 │ type t = t
2 │

This type constructor, `t`, can't be found.
If you wanted to write a recursive type, don't forget the `rec` in `type rec`
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/type_arity_mismatch.res:1:9-26

1 │ let xs: array<int, string> = []
2 │

The type constructor array expects 1 argument(s),
but is here applied to 2 argument(s)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/typetexp_unbound_type_constructor.res:1:8-23

1 │ let x: nonexistent_type = 1
2 │

This type constructor, `nonexistent_type`, can't be found.
If you wanted to write a recursive type, don't forget the `rec` in `type rec`
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

We've found a bug for you!
/.../fixtures/unbound_type_var.res:1:12

1 │ type t = ('a, int)
2 │

Unbound type parameter 'a
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Warning number 101 (configured as error)
/.../fixtures/warning_101_bs_unused_attribute.res:1:1-3

1 │ @as("foo")
2 │ let x = 1
3 │

Unused attribute: @as
This attribute has no effect here.
For example, some attributes are only meaningful in externals.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Warning number 103
/.../fixtures/warning_103_bs_ffi.res:1:32-43

1 │ @val external setMode: @string [#Foo | #Bar] => unit = "setMode"
2 │
3 │ let _ = setMode(#Foo)

FFI warning: @string is redundant here, you can safely remove it
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Warning number 104
/.../fixtures/warning_104_bs_derive.res:2:1-12

1 │ @deriving(accessors)
2 │ type t = int
3 │

@deriving warning: accessors not applicable to this type


Warning number 104
/.../fixtures/warning_104_bs_derive.res:2:1-12

1 │ @deriving(accessors)
2 │ type t = int
3 │

@deriving warning: accessors not applicable to this type
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Warning number 12
/.../fixtures/warning_12_unused_pat.res:3:14

1 │ let describe = x =>
2 │ switch x {
3 │ | Some(0 | 0) => "zero"
4 │ | _ => "other"
5 │ }

this sub-pattern is unused.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Warning number 23
/.../fixtures/warning_23_useless_record_with.res:4:10-27

2 │
3 │ let r = {a: 1, b: 2}
4 │ let r2 = {...r, a: 3, b: 4}
5 │
6 │ let _ = r2

All the fields are already explicitly listed in this record. You can remove the `...` spread.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Warning number 28
/.../fixtures/warning_28_wildcard_arg_to_constant_constr.res:5:9

3 │ let f = x =>
4 │ switch x {
5 │ | Foo(_) => 0
6 │ | Bar(_) => 1
7 │ }

wildcard pattern given as argument to a constant constructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Warning number 30
/.../fixtures/warning_30_duplicate_definitions.res:2:9-11

1 │ type a = Foo
2 │ and b = Foo
3 │

the constructor Foo is defined in both types a and b.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Warning number 33
/.../fixtures/warning_33_unused_open.res:1:1-17

1 │ open Stdlib_Array
2 │
3 │ let x = 1

unused open Stdlib_Array.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Warning number 34
/.../fixtures/warning_34_unused_type.res:4:3-23

2 │ let v: int
3 │ } = {
4 │ type unusedType = int
5 │ let v = 1
6 │ }

unused type unusedType.
Loading
Loading