Fix `unresolved` types in `get-scope`
Motivation and Context
There was an issue reported by serokell team that after ligo 0.51.0
there was a lot of unresolved
types for definitions
The root cause of the problem was that the stdlib
was not loaded in the typing context used by get-scope
Fixes #1514 (closed)
Description
This MR add stdlib
in the type context used by get-scope & it also fixes an issue where type could not be resolved for mutable let bindings
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
For a file like
type user = {
is_admin : bool,
};
const alice : user = {
is_admin : true,
};
const alice_admin : bool = alice.i
Before fix
$ ligo.57 info get-scope y.jsligo --format dev --with-types
...
Variable definitions:
(alice#1 -> alice)
...
Content: |unresolved|
...
(alice_admin#2 -> alice_admin)
...
Content: |unresolved|
...
...
After fix
$ ligo info get-scope y.jsligo --format dev --with-types
...
Variable definitions:
(alice#1 -> alice)
...
Content: |core: user|
...
(alice_admin#2 -> alice_admin)
...
Content: |core: bool|
...
...
Checklist:
-
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).
Edited by Melwyn Saldanha