#How come unsafe "clone" isn't working on a fixed array?
1 messages · Page 1 of 1 (latest)
remove the unsafe {}, it is not implemented for fixed arrays
and file an issue
it should have been either a checker error, or a nop op; not a cgen error
thanks, i'll open an issue 🙂
Issue created here: https://github.com/vlang/v/issues/17642
thanks
will the checker error be temporary as they are not implemented in the code generation stage?
if there is a checker error, the compilation will stop, and so cgen will not error
but it should be implemented right?
I think you have answered your own question
I got confused actually
there are several alternatives - a checker error, or a cgen implementation; if one is implemented, the other is not needed; one can reasonably choose either of them
note, that fixed arrays unlike dynamic ones, can not share memory blocks, so the unsafe {} copy op, that is needed sometimes for the dynamic ones, is not useful for fixed arrays - they can just use a2 := a1 without unsafe{}, which already works, and thus a2 := unsafe { a1 } can be a NOP - it does not need to do anything more/different than what a2 := a1 already does
I hope that clears your confusion.
it does clear my confusion