Moves disallowed in top-level block
Buldram opened this issue · comments
Buldram commented
Description
type MyIsolated[T] = object
val: T
proc `=copy`*[T](dest: var MyIsolated[T]; src: MyIsolated[T]) {.error.}
block:
let a = MyIsolated[int](val: 3)
let b = a
Reports that a
must be copied, I'd guess it's being handled as if it's a global variable.
Nim Version
Current Output
(8, 11) Error: '=copy' is not available for type <MyIsolated>; requires a copy because it's not the last read of 'a'; routine: a
Expected Output
No response
Possible Solution
No response
Additional Information
No response