E4071

E4071#

Multiple intrinsic is not supported. You have defined a function to use multiple intrinsics.

Note all intrinsic is not intended for usage outside of moonbitlang/core and is subject to change without notice, and we highly recommend against using them.

Erroneous example#

pub(all) struct MyArray[T](Array[T])

#intrinsic("%array.get")
#intrinsic("%fixedarray.get")
pub fn[T] MyArray::get(self : MyArray[T], index : Int) -> T {
  self.0[index]
}

Suggestion#

Remove the extra intrinsic and use only one intrinsic:

pub(all) struct MyArray[T](Array[T])

#intrinsic("%array.get")
pub fn[T] MyArray::get(self : MyArray[T], index : Int) -> T {
  self.0[index]
}

Avoid directly using intrinsics as much as possible, as we may change or remove them in the future. If you really need to use the intrinsic, you can check the source code of moonbitlang/core for further usage of the corresponding intrinsic.