Motivation and Context
unused (for finding unused bindings) &
muchused (for checking linearity for tickets) did not decend into the declarations of
E_mod_in (location module in an expression).
Which caused unnecessary unused warnings for binding & no warnings in duplicate tickets.
Fixes #1672 (closed)
This MR fixes these issues.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Performance improvement (non-breaking change that improves performance)
None (change with no changelog)
For a contract like
let fst (x, _) = x let snd (_, x) = x let main (_ : unit * nat ticket) : operation list * nat ticket = let n = 10n in module B = struct let ticket = Option.unopt (Tezos.create_ticket n n) let y = ticket, ticket end in , Option.unopt (Tezos.join_tickets (fst B.y, snd B.y))
ligo.60 compile contract y.mligo File "y.mligo", line 6, characters 6-7: 5 | let main (_ : unit * nat ticket) : operation list * nat ticket = 6 | let n = 10n in 7 | module B = struct : Warning: unused variable "n". Hint: replace it by "_n" to prevent this warning. Error(s) occurred while type checking the contract: Ill typed contract: ...
$ _build/install/default/bin/ligo compile contract y.mligo File "y.mligo", line 8, characters 8-14: 7 | module B = struct 8 | let ticket = Option.unopt (Tezos.create_ticket n n) 9 | let y = ticket, ticket : Warning: variable "ticket" cannot be used more than once. File "y.mligo", line 9, characters 4-26: 8 | let ticket = Option.unopt (Tezos.create_ticket n n) 9 | let y = ticket, ticket 10 | end in : Warning: variable "B.y" cannot be used more than once. Error(s) occurred while type checking the contract: Ill typed contract: ...
Changes follow the existing coding style (use
dune @fmtto check).
Tests for the changes have been added (for bug fixes / feature).
Documentation has been updated.
Changelog description has been added (if appropriate).
Start titles under
## Changelogsection with #### (if appropriate).
There is no image or uploaded file in changelog
Examples in changed behaviour have been added to the changelog (for breaking change / feature).