v0.13.7
errors and warnings / parsing

errors and warnings / parsing / E0109

E0109 error

Decorator not followed by a decoratable declaration

area
parsing (x01xx)
fails the build
yes

A decorator (@name or @name(…)) stands before a statement that can't be decorated, such as a call or an assignment. Decorators apply to declarations: functions, local, const, classes, class members, enums and the like. Put the decorator right before the declaration it is meant for.

Example

× failswowlua
@deprecatedprint("old API")
✓ compileswowlua
@deprecatedlocal function oldApi()    print("old API")end

The compiler reports it like this:

error[E0109]: a decorator must be followed by a declaration (function, local, const, class, …)
  ┌─ src/main.wowlua:1:1
  │  
1 │ ╭ @deprecated
2 │ │ print("old API")
  │ ╰────────────────^ here

Offline

terminal
$ wowlua explain E0109
E0109 (error): Decorator not followed by a decoratable declaration

source on GitHub ↗