Return a new array made of values.

The dynamic type of the result is Array[elttype].

Property definitions

nitc $ NaiveInterpreter :: array_instance
	# Return a new array made of `values`.
	# The dynamic type of the result is Array[elttype].
	fun array_instance(values: Array[Instance], elttype: MType): Instance
	do
		assert not elttype.need_anchor
		var nat = new PrimitiveInstance[Array[Instance]](mainmodule.native_array_type(elttype), values)
		init_instance_primitive(nat)
		var mtype = mainmodule.array_type(elttype)
		var res = new MutableInstance(mtype)
		self.init_instance(res)
		self.send(self.force_get_primitive_method("with_native", mtype), [res, nat, self.int_instance(values.length)])
		return res
	end
src/interpreter/naive_interpreter.nit:306,2--318,4