E4020

E4020#

Package not found in the loaded packages.

Erroneous Example#

let a = @boolean.to_int(true)

The example above tries to call the method to_int in a package boolean, but this package is not present in the list of loaded packages, giving the following error on line 1:

Package "boolean" not found in the loaded packages.

Suggestion#

Make sure the package name is valid.

If it is not a package in module moonbitlang/core, make sure that it is mentioned as one of the imported packages in moon.pkg.json as well.

In the above example, the package name should be @bool instead of @boolean:

let a = @bool.to_int(true)