leo/docs/error-guides/parser/context_annotation.md
2022-02-28 09:42:37 -08:00

562 B

@context function is deprecated

Example

This error occurs when a function is prefixed with @context.

Erroneous code example:

@context()
function foo() {
    // logic...
}

The compiler will reject this code with, for example...:

Error [EPAR0370017]: "@context(...)" is deprecated. Did you mean @test annotation?
    --> test.leo:1:2
     |
   1 | @context()
     |  ^^^^^^^

Solution

The @context function syntax is deprecated, but you can use @test function instead:

@test
function foo() {
    // logic...
}