Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves disallowed in top-level block #23539

Open
Buldram opened this issue Apr 25, 2024 · 0 comments
Open

Moves disallowed in top-level block #23539

Buldram opened this issue Apr 25, 2024 · 0 comments

Comments

@Buldram
Copy link

Buldram commented Apr 25, 2024

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

cd3cf3a

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant