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
export local M = {}export function M.greet() print("hello")endexport local M = {}function M.greet() print("hello")endThe compiler reports it like this:
error[E0118]: `export function` takes a plain name ┌─ src/main.wowlua:2:17 │ 2 │ export function M.greet() │ ^^^^^^^ here
Related codes
| code | message |
|---|---|
| E1016 | An export redeclares a module-level name (a local, function, import, …), or a name is exported twice |
Offline
$ wowlua explain E0118 E0118 (error): export function with a dotted or method name