Skip to content

Internal: add new `@deprecated` attribute to CameLIGO

E. Rivas requested to merge er433/feat/deprecated-attr into dev

Motivation and Context

We need a new attribute for CameLIGO in order to mark deprecated code functions in stdlib.

Description

This MR adds a new attribute deprecated in the AST, and which can be used to mark deprecation:

module Foo = struct
  [@deprecated "Please.@.Change me for g."] let f () = 42
  let g () = 1
end

let test = Test.log (Foo.f ())

The @. are replaced by newlines, @@ is used to escape @.

$ ligo run test depre.mligo
File "depre.mligo", line 6, characters 21-26:
  5 | 
  6 | let test = Test.log (Foo.f ())
:
Warning: deprecated value.
Please.
Change me for g.

42
Everything at the top-level was executed.
- test exited with value ().

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).
Edited by E. Rivas

Merge request reports

Loading