v0.13.7
errors and warnings / parsing

errors and warnings / parsing / E0118

E0118 error

export function with a dotted or method name

area
parsing (x01xx)
fails the build
yes

export function is followed by a dotted or method name (M.f, M:m). An export names a module-level local, so it takes a plain name. Export the function by its own name, or export the table and add functions to it.

Example

× failswowlua
export local M = {}export function M.greet()    print("hello")end
✓ compileswowlua
export local M = {}function M.greet()    print("hello")end

The compiler reports it like this:

error[E0118]: `export function` takes a plain name
  ┌─ src/main.wowlua:2:17
  │
2 │ export function M.greet()
  │                 ^^^^^^^ here
codemessage
E1016An export redeclares a module-level name (a local, function, import, …), or a name is exported twice

Offline

terminal
$ wowlua explain E0118
E0118 (error): export function with a dotted or method name

source on GitHub ↗