Skip to content

Commit

Permalink
Improve Unused Declaration Detection (Switch/Catch Clauses, No Warnin…
Browse files Browse the repository at this point in the history
…gs on Type Check Errors) (#4560)

Fix for issue: #4508
* Correctly detect used and unused declaration in switch and try-catch clauses.

Only warn on unused identifiers if type-checking is error-free (#4561)
* Avoid potential spurious cascading warnings in the presence of type checker errors.

Updated:
* Expected warnings in Motoko test cases.
* Refactoring of the Motoko base library to comply with the improved detection: dfinity/motoko-base#636
  • Loading branch information
luc-blaeser authored Jun 7, 2024
1 parent c899462 commit b88253d
Show file tree
Hide file tree
Showing 123 changed files with 264 additions and 196 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Motoko compiler changelog

## 0.11.2 (to come)

* motoko (`moc`)

* bugfix: Fix the detection of unused declarations in switch and catch cases (#4560).
* improvement: Only warn on unused identifiers if type checking is error-free (#4560).

## 0.11.1 (2024-03-15)

* motoko (`moc`)
Expand Down
4 changes: 3 additions & 1 deletion src/lang_utils/diag.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let add_msgs s ms = s := List.rev ms @ !s
let get_msgs s = List.rev !s

let has_errors : messages -> bool =
List.fold_left (fun b msg -> b || msg.sev == Error) false
List.exists (fun msg -> msg.sev == Error)

let string_of_message msg =
let code = match msg.sev, msg.code with
Expand All @@ -77,6 +77,8 @@ let print_message msg =

let print_messages = List.iter print_message

let is_error_free (ms: msg_store) = not (has_errors (get_msgs ms))

let with_message_store f =
let s = ref [] in
let r = f s in
Expand Down
1 change: 1 addition & 0 deletions src/lang_utils/diag.mli
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ the reported messages contain an error.
*)

type msg_store
val is_error_free : msg_store -> bool
val add_msg : msg_store -> message -> unit
val add_msgs : msg_store -> messages -> unit
val with_message_store : (msg_store -> 'a option) -> 'a result
Expand Down
11 changes: 7 additions & 4 deletions src/mo_frontend/typing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ let ignore_warning_for_id id =
false

let detect_unused env inner_identifiers =
if env.check_unused then
if not env.pre && env.check_unused then
T.Env.iter (fun id (_, at, kind) ->
if (not (ignore_warning_for_id id)) && (is_unused_identifier env id) then
add_unused_warning env (id, at, kind)
Expand Down Expand Up @@ -1998,8 +1998,11 @@ and check_cases env t_pat t cases =

and check_case env t_pat t case =
let {pat; exp} = case.it in
let initial_usage = enter_scope env in
let ve = check_pat env t_pat pat in
recover (check_exp (adjoin_vals env ve) t) exp
let t' = recover (check_exp (adjoin_vals env ve) t) exp in
leave_scope env ve initial_usage;
t'

and inconsistent t ts =
T.opaque t && not (List.exists T.opaque ts)
Expand Down Expand Up @@ -2931,7 +2934,7 @@ let infer_prog scope pkg_opt async_cap prog : (T.typ * Scope.t) Diag.result =
env0 with async = async_cap;
} in
let res = infer_block env prog.it prog.at true in
if pkg_opt = None then emit_unused_warnings env;
if pkg_opt = None && Diag.is_error_free msgs then emit_unused_warnings env;
res
) prog
)
Expand Down Expand Up @@ -3011,7 +3014,7 @@ let check_lib scope pkg_opt lib : Scope.t Diag.result =
(* this shouldn't really happen, as an imported program should be rewritten to a module *)
error env cub.at "M0000" "compiler bug: expected a module or actor class but found a program, i.e. a sequence of declarations"
in
if pkg_opt = None then emit_unused_warnings env;
if pkg_opt = None && Diag.is_error_free msgs then emit_unused_warnings env;
Scope.lib lib.note.filename imp_typ
) lib
)
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion test/fail/ok/M0127.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ M0127.mo:2.3-2.40: type error [M0127], system function preupgrade is declared wi
<system>Bool -> ()
instead of expected type
<system>() -> ()
M0127.mo:2.26-2.29: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
5 changes: 0 additions & 5 deletions test/fail/ok/abstract-msgs.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ abstract-msgs.mo:16.34-16.35: type error [M0031], shared function has non-shared
A__16
abstract-msgs.mo:17.27-17.47: type error [M0032], shared function has non-shared return type
A__17
abstract-msgs.mo:2.33-2.34: warning [M0194], unused identifier x (delete or rename to wildcard `_` or `_x`)
abstract-msgs.mo:4.11-4.14: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
abstract-msgs.mo:5.25-5.26: warning [M0194], unused identifier x (delete or rename to wildcard `_` or `_x`)
abstract-msgs.mo:23.38-23.41: warning [M0194], unused identifier bar (delete or rename to wildcard `_` or `_bar`)
abstract-msgs.mo:23.42-23.43: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
4 changes: 0 additions & 4 deletions test/fail/ok/argument-subtyping.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ argument-subtyping.mo:12.61-12.62: type error [M0096], expression of type
shared Nat -> ()
cannot produce expected type
shared Text -> ()
argument-subtyping.mo:2.11-2.14: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
argument-subtyping.mo:5.11-5.14: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
argument-subtyping.mo:8.11-8.14: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
argument-subtyping.mo:9.11-9.14: warning [M0194], unused identifier foo (delete or rename to wildcard `_` or `_foo`)
1 change: 0 additions & 1 deletion test/fail/ok/asyncret2.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ asyncret2.mo:1.54-1.57: type error [M0096], expression of type
async<$call3> Int
cannot produce expected type
Int
asyncret2.mo:1.6-1.11: warning [M0194], unused identifier call3 (delete or rename to wildcard `_` or `_call3`)
4 changes: 0 additions & 4 deletions test/fail/ok/bad-async-sort.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ Use keyword 'async*' (not 'async') to produce the expected type.
bad-async-sort.mo:23.14-23.23: type error [M0183], async expression cannot produce expected async type
async<$anon4> ().
Use keyword 'async' (not 'async*') to produce the expected type.
bad-async-sort.mo:10.8-10.13: warning [M0194], unused identifier anon1 (delete or rename to wildcard `_` or `_anon1`)
bad-async-sort.mo:14.8-14.13: warning [M0194], unused identifier anon2 (delete or rename to wildcard `_` or `_anon2`)
bad-async-sort.mo:18.8-18.13: warning [M0194], unused identifier anon3 (delete or rename to wildcard `_` or `_anon3`)
bad-async-sort.mo:22.8-22.13: warning [M0194], unused identifier anon4 (delete or rename to wildcard `_` or `_anon4`)
4 changes: 0 additions & 4 deletions test/fail/ok/bad-unops.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ bad-unops.mo:6.20-6.22: type error [M0111], operator pattern cannot consume expe
bad-unops.mo:8.20-8.22: warning [M0146], this pattern is never matched
bad-unops.mo:10.21-10.23: type error [M0111], operator pattern cannot consume expected type
Int
bad-unops.mo:1.5-1.6: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
bad-unops.mo:2.5-2.6: warning [M0194], unused identifier b (delete or rename to wildcard `_` or `_b`)
bad-unops.mo:3.5-3.6: warning [M0194], unused identifier c (delete or rename to wildcard `_` or `_c`)
bad-unops.mo:4.5-4.6: warning [M0194], unused identifier d (delete or rename to wildcard `_` or `_d`)
5 changes: 0 additions & 5 deletions test/fail/ok/bang-fail.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ bang-fail.mo:18.17-18.19: type error [M0096], expression of type
()
cannot produce expected type
Nat
bang-fail.mo:1.6-1.12: warning [M0194], unused identifier wrong1 (delete or rename to wildcard `_` or `_wrong1`)
bang-fail.mo:5.6-5.12: warning [M0194], unused identifier wrong2 (delete or rename to wildcard `_` or `_wrong2`)
bang-fail.mo:9.6-9.12: warning [M0194], unused identifier wrong3 (delete or rename to wildcard `_` or `_wrong3`)
bang-fail.mo:13.6-13.12: warning [M0194], unused identifier wrong4 (delete or rename to wildcard `_` or `_wrong4`)
bang-fail.mo:17.6-17.12: warning [M0194], unused identifier wrong5 (delete or rename to wildcard `_` or `_wrong5`)
16 changes: 0 additions & 16 deletions test/fail/ok/bounds-mismatch.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,3 @@ cannot produce expected type
bounds-mismatch.mo:125.21-128.4: warning [M0074], this array has type
[Any]
because elements have inconsistent types
bounds-mismatch.mo:2.10-2.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:7.10-7.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:12.10-12.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:17.10-17.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:22.10-22.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:27.10-27.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:32.10-32.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:37.10-37.11: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
bounds-mismatch.mo:75.6-75.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:81.6-81.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:87.6-87.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:93.6-93.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:99.6-99.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:106.6-106.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
bounds-mismatch.mo:126.41-126.42: warning [M0194], unused identifier b (delete or rename to wildcard `_` or `_b`)
bounds-mismatch.mo:127.41-127.42: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
2 changes: 0 additions & 2 deletions test/fail/ok/check-record.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ check-record.mo:24.9-24.27: type error [M0096], expression of type
{a : Nat}
cannot produce expected type
{b : Nat}
check-record.mo:6.5-6.6: warning [M0194], unused identifier r (delete or rename to wildcard `_` or `_r`)
check-record.mo:20.7-20.8: warning [M0194], unused identifier b (delete or rename to wildcard `_` or `_b`)
1 change: 0 additions & 1 deletion test/fail/ok/const-var-array.tc.ok
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
const-var-array.mo:1.17-1.22: type error [M0091], mutable array expression cannot produce expected type
[Nat]
const-var-array.mo:1.5-1.6: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
1 change: 0 additions & 1 deletion test/fail/ok/const-var-field.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ const-var-field.mo:1.21-1.48: type error [M0096], expression of type
{var x : Nat}
cannot produce expected type
{x : Nat}
const-var-field.mo:1.5-1.6: warning [M0194], unused identifier o (delete or rename to wildcard `_` or `_o`)
27 changes: 0 additions & 27 deletions test/fail/ok/f-bounds-fail.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -174,30 +174,3 @@ f-bounds-fail.mo:82.26-82.27: type error [M0096], expression of type
B__13
cannot produce expected type
C__9
f-bounds-fail.mo:3.5-3.6: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
f-bounds-fail.mo:5.6-5.9: warning [M0194], unused identifier f2a (delete or rename to wildcard `_` or `_f2a`)
f-bounds-fail.mo:7.6-7.9: warning [M0194], unused identifier f2b (delete or rename to wildcard `_` or `_f2b`)
f-bounds-fail.mo:9.6-9.9: warning [M0194], unused identifier f3a (delete or rename to wildcard `_` or `_f3a`)
f-bounds-fail.mo:10.6-10.9: warning [M0194], unused identifier f3b (delete or rename to wildcard `_` or `_f3b`)
f-bounds-fail.mo:11.6-11.9: warning [M0194], unused identifier f3c (delete or rename to wildcard `_` or `_f3c`)
f-bounds-fail.mo:45.6-45.8: warning [M0194], unused identifier u0 (delete or rename to wildcard `_` or `_u0`)
f-bounds-fail.mo:46.6-46.8: warning [M0194], unused identifier u1 (delete or rename to wildcard `_` or `_u1`)
f-bounds-fail.mo:47.6-47.8: warning [M0194], unused identifier u2 (delete or rename to wildcard `_` or `_u2`)
f-bounds-fail.mo:48.6-48.8: warning [M0194], unused identifier u3 (delete or rename to wildcard `_` or `_u3`)
f-bounds-fail.mo:49.6-49.8: warning [M0194], unused identifier u4 (delete or rename to wildcard `_` or `_u4`)
f-bounds-fail.mo:50.6-50.8: warning [M0194], unused identifier u5 (delete or rename to wildcard `_` or `_u5`)
f-bounds-fail.mo:51.6-51.8: warning [M0194], unused identifier u6 (delete or rename to wildcard `_` or `_u6`)
f-bounds-fail.mo:53.6-53.8: warning [M0194], unused identifier v0 (delete or rename to wildcard `_` or `_v0`)
f-bounds-fail.mo:54.6-54.8: warning [M0194], unused identifier v1 (delete or rename to wildcard `_` or `_v1`)
f-bounds-fail.mo:55.6-55.8: warning [M0194], unused identifier v2 (delete or rename to wildcard `_` or `_v2`)
f-bounds-fail.mo:56.6-56.8: warning [M0194], unused identifier v3 (delete or rename to wildcard `_` or `_v3`)
f-bounds-fail.mo:57.6-57.8: warning [M0194], unused identifier v4 (delete or rename to wildcard `_` or `_v4`)
f-bounds-fail.mo:58.6-58.8: warning [M0194], unused identifier v5 (delete or rename to wildcard `_` or `_v5`)
f-bounds-fail.mo:59.6-59.8: warning [M0194], unused identifier v6 (delete or rename to wildcard `_` or `_v6`)
f-bounds-fail.mo:61.6-61.8: warning [M0194], unused identifier w0 (delete or rename to wildcard `_` or `_w0`)
f-bounds-fail.mo:62.6-62.8: warning [M0194], unused identifier w1 (delete or rename to wildcard `_` or `_w1`)
f-bounds-fail.mo:63.6-63.8: warning [M0194], unused identifier w2 (delete or rename to wildcard `_` or `_w2`)
f-bounds-fail.mo:64.6-64.8: warning [M0194], unused identifier w3 (delete or rename to wildcard `_` or `_w3`)
f-bounds-fail.mo:65.6-65.8: warning [M0194], unused identifier w4 (delete or rename to wildcard `_` or `_w4`)
f-bounds-fail.mo:66.6-66.8: warning [M0194], unused identifier w5 (delete or rename to wildcard `_` or `_w5`)
f-bounds-fail.mo:67.6-67.8: warning [M0194], unused identifier w6 (delete or rename to wildcard `_` or `_w6`)
16 changes: 0 additions & 16 deletions test/fail/ok/inference.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,3 @@ because no instantiation of T__117 makes
{type x = Nat} <: {x : T__117}
inference.mo:183.8-183.21: type error [M0045], wrong number of type arguments: expected 2 but got 0
inference.mo:186.8-186.15: type error [M0045], wrong number of type arguments: expected 1 but got 0
inference.mo:11.14-11.15: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
inference.mo:51.6-51.11: warning [M0194], unused identifier mult1 (delete or rename to wildcard `_` or `_mult1`)
inference.mo:53.6-53.11: warning [M0194], unused identifier mult2 (delete or rename to wildcard `_` or `_mult2`)
inference.mo:56.16-56.17: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
inference.mo:75.19-75.20: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:88.23-88.24: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:89.23-89.24: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:90.23-90.24: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:135.6-135.7: warning [M0194], unused identifier g (delete or rename to wildcard `_` or `_g`)
inference.mo:136.20-136.21: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:140.6-140.7: warning [M0194], unused identifier h (delete or rename to wildcard `_` or `_h`)
inference.mo:141.20-141.21: warning [M0194], unused identifier y (delete or rename to wildcard `_` or `_y`)
inference.mo:145.6-145.7: warning [M0194], unused identifier i (delete or rename to wildcard `_` or `_i`)
inference.mo:150.6-150.7: warning [M0194], unused identifier j (delete or rename to wildcard `_` or `_j`)
inference.mo:155.6-155.7: warning [M0194], unused identifier k (delete or rename to wildcard `_` or `_k`)
inference.mo:180.19-180.20: warning [M0194], unused identifier u (delete or rename to wildcard `_` or `_u`)
13 changes: 0 additions & 13 deletions test/fail/ok/issue-3318.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,3 @@ issue-3318.mo:33.43-33.44: type error [M0096], expression of type
(Nat, Nat) -> ((Nat, Nat))
cannot produce expected type
((Nat, Nat)) -> ((Nat, Nat))
issue-3318.mo:2.13-2.14: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
issue-3318.mo:11.6-11.8: warning [M0194], unused identifier t0 (delete or rename to wildcard `_` or `_t0`)
issue-3318.mo:14.6-14.8: warning [M0194], unused identifier t1 (delete or rename to wildcard `_` or `_t1`)
issue-3318.mo:17.6-17.8: warning [M0194], unused identifier t2 (delete or rename to wildcard `_` or `_t2`)
issue-3318.mo:20.6-20.8: warning [M0194], unused identifier t3 (delete or rename to wildcard `_` or `_t3`)
issue-3318.mo:23.6-23.8: warning [M0194], unused identifier t4 (delete or rename to wildcard `_` or `_t4`)
issue-3318.mo:26.6-26.8: warning [M0194], unused identifier t5 (delete or rename to wildcard `_` or `_t5`)
issue-3318.mo:29.6-29.8: warning [M0194], unused identifier t6 (delete or rename to wildcard `_` or `_t6`)
issue-3318.mo:32.6-32.8: warning [M0194], unused identifier t7 (delete or rename to wildcard `_` or `_t7`)
issue-3318.mo:35.6-35.8: warning [M0194], unused identifier t8 (delete or rename to wildcard `_` or `_t8`)
issue-3318.mo:40.6-40.8: warning [M0194], unused identifier u0 (delete or rename to wildcard `_` or `_u0`)
issue-3318.mo:42.6-42.8: warning [M0194], unused identifier u1 (delete or rename to wildcard `_` or `_u1`)
issue-3318.mo:44.6-44.8: warning [M0194], unused identifier u2 (delete or rename to wildcard `_` or `_u2`)
1 change: 0 additions & 1 deletion test/fail/ok/issue2062.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ issue2062.mo:2.3-3.11: type error [M0096], expression of type
()
cannot produce expected type
Nat
issue2062.mo:1.6-1.9: warning [M0194], unused identifier fac (delete or rename to wildcard `_` or `_fac`)
1 change: 0 additions & 1 deletion test/fail/ok/missing-semi.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ missing-semi.mo:3.5-4.1: info, this looks like an unintended function call, perh
missing-semi.mo:9.3-9.7: type error [M0097], expected function type, but expression produces type
()
missing-semi.mo:9.7-10.3: info, this looks like an unintended function call, perhaps a missing ';'?
missing-semi.mo:7.6-7.7: warning [M0194], unused identifier f (delete or rename to wildcard `_` or `_f`)
10 changes: 0 additions & 10 deletions test/fail/ok/non_static_module.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,3 @@ non_static_module.mo:11.4-11.13: type error [M0014], non-static expression in li
non_static_module.mo:20.12-20.15: type error [M0014], non-static expression in library or module
non_static_module.mo:21.12-21.19: type error [M0014], non-static expression in library or module
non_static_module.mo:22.4-22.13: type error [M0014], non-static expression in library or module
non_static_module.mo:5.7-5.8: warning [M0194], unused identifier x (delete or rename to wildcard `_` or `_x`)
non_static_module.mo:6.7-6.8: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
non_static_module.mo:8.10-8.16: warning [M0194], unused identifier WrongO (delete or rename to wildcard `_` or `_WrongO`)
non_static_module.mo:11.8-11.9: warning [M0194], unused identifier x (delete or rename to wildcard `_` or `_x`)
non_static_module.mo:14.10-14.13: warning [M0194], unused identifier OkO (delete or rename to wildcard `_` or `_OkO`)
non_static_module.mo:16.9-16.10: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
non_static_module.mo:19.10-19.16: warning [M0194], unused identifier WrongM (delete or rename to wildcard `_` or `_WrongM`)
non_static_module.mo:22.8-22.9: warning [M0194], unused identifier x (delete or rename to wildcard `_` or `_x`)
non_static_module.mo:25.10-25.13: warning [M0194], unused identifier OkM (delete or rename to wildcard `_` or `_OkM`)
non_static_module.mo:27.9-27.10: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
1 change: 0 additions & 1 deletion test/fail/ok/object-ext-poly.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ object-ext-poly.mo:2.5-2.32: type error [M0096], expression of type
{a : Int; b : Char; c : Text}
cannot produce expected type
A__9
object-ext-poly.mo:1.6-1.9: warning [M0194], unused identifier mix (delete or rename to wildcard `_` or `_mix`)
1 change: 0 additions & 1 deletion test/fail/ok/objpat-infer.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ objpat-infer.mo:35.15-35.23: type error [M0096], expression of type
actor {}
cannot produce expected type
{}
objpat-infer.mo:17.17-17.18: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
2 changes: 0 additions & 2 deletions test/fail/ok/one-tuple-ambiguity.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ one-tuple-ambiguity.mo:16.3-16.5: type error [M0050], literal of type
Nat
does not have expected type
(Nat, Bool)
one-tuple-ambiguity.mo:13.9-13.10: warning [M0194], unused identifier a (delete or rename to wildcard `_` or `_a`)
one-tuple-ambiguity.mo:13.18-13.19: warning [M0194], unused identifier b (delete or rename to wildcard `_` or `_b`)
1 change: 0 additions & 1 deletion test/fail/ok/pat-inconsistent.tc.ok
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ pat-inconsistent.mo:58.1-60.2: warning [M0145], this switch of type
does not cover value
#sparrows
pat-inconsistent.mo:64.10-64.18: warning [M0146], this pattern is never matched
pat-inconsistent.mo:62.6-62.12: warning [M0194], unused identifier absurd (delete or rename to wildcard `_` or `_absurd`)
Loading

0 comments on commit b88253d

Please sign in to comment.