[TM-350] Remove parameter and storage aliases
Description
Problem: Morley language supports implicit Parameter and Storage
type aliases, so one can write parameter
and it will be replaced
with concrete parameter type of the current contract. This feature
causes some inconvenience: most of the code is written with assumption
that Untyped.Type
is concrete, i. e. does not contain aliases.
However, it is not know statically, so we have to use error
everywhere.
Moreover, this assumption does not necessarily hold everywhere. It can be easily violated if we parse an instruction (not a contract) containing such an alias. In this case we just can't replace aliases with anything concrete.
This feature is not really useful: one can write type Param = …
in
let block and use it anywhere (including parameter
statement).
Moreover, usefulness of the Morley language is questionable as there
are more powerful alternatives (e. g. one can use Lorentz).
Since usefulness of this feature is close to 0 and inconvenience
caused by it is really above 0, it seems better to remove it
completely.
Solution:
- Remove
TypeParameter
andTypeStorage
constructor, parsers. - Remove description of this feature from docs.
- Remove 'explicitType' tests (because we don't distinguish explicit and implicit types anymore) and replace Storage/Parameter types in other parser tests with concrete types.
- Remove/update test contracts with this feature.
- Permit Storage and Parameter type aliases.
Related issue(s)
https://issues.serokell.io/issue/TM-350
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.