Skip to content

List-declarations: fix `--only-ep` for non-generated `@entry` marked in

E. Rivas requested to merge er433/fix/only-ep into dev

Motivation and Context

Laurent reported that for:

type storage = int;
type ret = [list<operation>, storage];
// Three entrypoints

@entry
const increment = (delta: int, store: storage): ret =>
  [list([]), store + delta];
@entry
const decrement = (delta: int, store: storage): ret =>
  [list([]), store - delta];
@entry
const reset = (_p: unit, _s: storage): ret => [list([]), 0]

we get the list of entrypoints wrong:

$ ligo info list-declarations --skip-generated --no-color --only-ep --display-format dev test.jsligo
test.jsligo declarations:

$

Description

This is because the function used to check the entrypoint assumes the entrypoint is "a contract" p * s -> operation list * s. We add an extra case for attr.entry, and check that the type of the entrypoint is curried p -> s -> operation list * s.

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