E4228

E4228#

Compiler diagnostic name: invalid_import_all.

An import uses * outside a .mbtx script.

Import-all syntax brings a package's definitions into the script's scope and is intentionally limited to script mode. Regular packages must access an import through its package alias or import selected names with using.

Erroneous example#

import {
  "moonbitlang/core/list" *
}

Suggestion#

Use a normal package alias in moon.pkg, then qualify names from that package. Alternatively, move genuinely script-like code and its import header to a .mbtx file.

import {
  "moonbitlang/core/list" @list
}