E4070

E4070#

Unknown intrinsic. This intrinsic is not known to the MoonBit compiler.

このエラーは、代わりに使える通常の関数本体がない直接の組み込み命令宣言(fn ... = "name")に対して発生します。一方、#intrinsic("name") 属性の未知の名前は警告 E0094 となり、属性が無視されて通常の関数本体が使われます。

Intrinsics are not intended for usage outside of moonbitlang/core. They are subject to change without notice, and we highly recommend against using them.

誤った例#

///|
pub fn my_abort(message : String) -> Unit = "%not_a_real_intrinsic"
// Error: Unknown intrinsic: %not_a_real_intrinsic

修正案#

You probably want to use the abort function from moonbitlang/core:

///|
pub fn my_abort(message : String) -> Unit {
  abort(message)
}

If you really need to use the intrinsic, you can check the source code of moonbitlang/core for further usage of the corresponding intrinsic.