Add ability to coerce between expressions of the compatible types.
Clarification and motivation
The need for this came up when trying to create a View
entrypoint with FA2 specified annotations. Right now the View
s gets generated with %viewCallbackTo
annotation for the contract
field. But FA2 required [1] it to be annotated with %callback
.
A solution for this was attempted by making a new type, that have the same structure as the View
, with the required annotations, using the HasAnnotation
infra. But it turned out to be impossible to use it with Indigo
s View
helper functions, since it expect View
expressions. It appears that if there was something to coerce a Var
of such type to a Var View
, we could use the new type with such functions that require View
.
[1] https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-12/tzip-12.md#balance_of
Acceptance criteria
Indigo has some construct to allow coercing between expressions with same Michelson representation.