Proto/Michelson: fix `PAIR k` annots
Context
The PAIR k
instruction currently converts @
annotations on the
stack to %
annotations. For example, PAIR 2
works like
PAIR %@ %@
.
This causes troubles with typing, for example, this typechecks:
{ parameter unit;
storage unit;
code { SENDER @foo; SOURCE @bar; PAIR 2;
SOURCE @foo; SENDER @bar; PAIR 2;
COMPARE; DROP;
CDR; NIL operation; PAIR } }
but it fails to typecheck if the @foo
and @bar
annots are removed.
This makes it difficult to use PAIR k
in a compiler, because it may
cause type errors.
This change fixes the problem by merely removing the behavior.
PAIR k
will put no %
annotations at all on the result.
An alternative could be to allow the user to specify the field
annotations (allowing the user to opt in to the current behavior using
%@
) but this does not seem important.
Checklist
-
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment, theDevelopment Version
section ofCHANGES.md
for everything else). -
Select suitable reviewers using the Reviewers
field below.
Merge request reports
Activity
requested review from @rafoo_
added michelson ⚗ proto labels
Thank you for your contribution
, I have one remark:-
There are changes to proto-alpha:- →
src/proto_alpha/lib_protocol/script_ir_translator.ml
- → Please make sure changes are properly tagged
Proto:
and protocol reviewers are alerted..
- →
I,
, ran this inspection onSun, 16 May 2021 22:12:46 0000
. I usually run inspections every 6 hours and will try to edit my own comment if I have any updates. For more information see the Tezos documentation.Edited by Tezos Merbocop-
- Resolved by Raphaël Cauderlier
- Resolved by Tom Jack
assigned to @yrg
mentioned in merge request ligolang/ligo!1102 (merged)
added prioritymedium label
requested review from @mbouaziz
added priorityhigh typebug labels and removed prioritymedium label
added 308 commits
-
57d07789...f7e13378 - 305 commits from branch
tezos:master
- ec55bd82 - Proto/Michelson: fix `PAIR k` annots
- 7fff8c4d - add changelog entry
- ca5f5290 - lint
Toggle commit list-
57d07789...f7e13378 - 305 commits from branch
added 167 commits
-
ca5f5290...f0e415b3 - 164 commits from branch
tezos:master
- ceee334f - Proto/Michelson: fix `PAIR k` annots
- 502b65d3 - add changelog entry
- 9cd1c832 - lint
Toggle commit list-
ca5f5290...f0e415b3 - 164 commits from branch
added 2 commits