errors and warnings / classes / E3045
E3045 error
Statement-only wowlua:debug helper used as a value
- area
- classes (x3xxx)
- fails the build
- yes
A statement-only helper of wowlua:debug (assert, dump, time,
timeEnd, resetStats, watch) is used as a value. Builds that turn the
helper off remove the call with its arguments, so there would be no value
left. Call it on its own line; for a value, use Lua's assert (_G.assert).
Example
import assert from "wowlua:debug"local ok = assert(true, "x")print(ok)import assert from "wowlua:debug"local ready = trueassert(ready, "not ready")print(ready)The compiler reports it like this:
error[E3045]: `assert` can only be a call statement, because the call may be removed ┌─ src/main.wowlua:2:12 │ 2 │ local ok = assert(true, "x") │ ^^^^^^^^^^^^^^^^^ here
Related codes
| code | message |
|---|---|
| E3032 | Invalid @debugOnly function (returns values, or a call is used as an expression) |
Offline
$ wowlua explain E3045 E3045 (error): Statement-only wowlua:debug helper used as a value