Monomorphisation: add commutation with `let`
Motivation and Context
It was reported by Heitor that tools/debugger/ligo-debugger/test/contracts/tezos-types.mligo
doesn't work with compile contract
:
$ ligo compile contract tools/debugger/ligo-debugger/test/contracts/tezos-types.mligo
File "tools/debugger/ligo-debugger/test/contracts/tezos-types.mligo", line 1, characters 34-59:
1 | let empty () : 42 sapling_state = Tezos.sapling_empty_state
2 |
Cannot monomorphise the expression.
There were some changes on how let foo () = ...
compiles (expansion, pattern matching).
Description
In this MR we extend our monomorphisation pass with an internal pass that commutes (let x = t in u)@{T}
into let x = t in (u@{T})
.
Component
-
compiler -
website -
webide -
vscode-plugin -
debugger
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)
Changelog
Checklist:
-
If a new syntax has been introduced, put a message on slack ligo-lsp -
Changes follow the existing coding style (use dune @fmt
to 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 ## Changelog
section 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).
Merge request reports
Activity
assigned to @er433
added 9 commits
-
15ce5766...20b0c3fe - 8 commits from branch
dev
- a0354a76 - Merge branch 'dev' into er433/monomorphisation/commute
-
15ce5766...20b0c3fe - 8 commits from branch
added 1 commit
- 463deb24 - tests: add test file for monomorphisation of let
mentioned in commit ba45b23a
A new deploy preview is available on Netlify at https://2763-698f6f8f--ligolang.netlify.app, you can view the logs at https://app.netlify.com/sites/ligolang/deploys/64c950dda0694f1ba8cf34e5
Edited by Ligo Langadded 3 commits
-
b9f471a7...31fc25a1 - 2 commits from branch
dev
- d05c1872 - Merge branch 'dev' into er433/monomorphisation/commute
-
b9f471a7...31fc25a1 - 2 commits from branch
added 5 commits
-
d05c1872...824b8ad7 - 4 commits from branch
dev
- 00381271 - Merge branch 'dev' into er433/monomorphisation/commute
-
d05c1872...824b8ad7 - 4 commits from branch
added 5 commits
-
00381271...5f037dc7 - 4 commits from branch
dev
- 3a245077 - Merge branch 'dev' into er433/monomorphisation/commute
-
00381271...5f037dc7 - 4 commits from branch
added 12 commits
-
3a245077...df571d85 - 11 commits from branch
dev
- 1dfdd04c - Merge branch 'dev' into er433/monomorphisation/commute
-
3a245077...df571d85 - 11 commits from branch
added 7 commits
-
1dfdd04c...f274e905 - 6 commits from branch
dev
- bcc91206 - Merge branch 'dev' into er433/monomorphisation/commute
-
1dfdd04c...f274e905 - 6 commits from branch
requested review from @lesenechal.remi
mentioned in commit 500bed8b
unassigned @er433