You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
23
23
#### :nail_care: Polish
24
24
25
+
- Add some context to error message for unused variables. https://github.com/rescript-lang/rescript-compiler/pull/7050
25
26
- Improve error message when passing `children` prop to a component that doesn't accept it. https://github.com/rescript-lang/rescript-compiler/pull/7044
26
27
- Improve error messages for pattern matching on option vs non-option, and vice versa. https://github.com/rescript-lang/rescript-compiler/pull/7035
Copy file name to clipboardExpand all lines: jscomp/ext/warnings.ml
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -378,7 +378,8 @@ let message = function
378
378
|All_clauses_guarded ->
379
379
"this pattern-matching is not exhaustive.\n\
380
380
All clauses in this pattern-matching are guarded."
381
-
|Unused_varv|Unused_var_strictv -> "unused variable "^ v ^"."
381
+
|Unused_varv|Unused_var_strictv ->
382
+
Format.sprintf "unused variable %s.\n\nFix this by:\n- Deleting the variable if it's not used anymiore.\n- Prepending the variable name with `_` (like `_%s`) to ignore that the variable is unused.\n- Using the variable somewhere." v v
382
383
|Wildcard_arg_to_constant_constr ->
383
384
"wildcard pattern given as argument to a constant constructor"
0 commit comments