v0.13.6
errors and warnings / parsing

errors and warnings / parsing / E0117

E0117 error

import _ combined with other names

area
parsing (x01xx)
fails the build
yes

import _ is combined with other names, as in import _, clamp from "./math". import _ only makes sure a file loads first and binds nothing, so it must be the only name in its import. A named import already loads its module first, so drop the _.

Example

× failswowlua
import _, clamp from "./math"print(clamp(5, 0, 1))
✓ compilessrc/main.wowluawowlua
import clamp from "./math"print(clamp(5, 0, 1))
src/math.wowluawowlua
export function clamp(v: number, lo: number, hi: number): number    return math.max(lo, math.min(hi, v))end

The compiler reports it like this:

error[E0117]: `import _` cannot be combined with other names
  ┌─ src/main.wowlua:1:8
  │
1 │ import _, clamp from "./math"
  │        ^ here

Offline

terminal
$ wowlua explain E0117
E0117 (error): import _ combined with other names

source on GitHub ↗