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

Noncopyable base type ignored #24760

Open
arnetheduck opened this issue Mar 10, 2025 · 0 comments · May be fixed by #24777
Open

Noncopyable base type ignored #24760

arnetheduck opened this issue Mar 10, 2025 · 0 comments · May be fixed by #24777
Assignees

Comments

@arnetheduck
Copy link
Contributor

arnetheduck commented Mar 10, 2025

Nim Version

2.2

Description

type
  A {.inheritable.} = object
  B = object of A

proc `=copy`(a: var A, x: A) {.error.}
#proc `=copy`(a: var B, x: B) {.error.}

proc ffff(v: sink B) =
  echo v

proc g() =
  var b: B
  ffff(b)
  ffff(b)
g()

If I can't copy A, I obviously can't copy B..

Current Output

compiles

Expected Output

erorr

Known Workarounds

No response

Additional Information

No response

@ringabout ringabout self-assigned this Mar 11, 2025
@ringabout ringabout linked a pull request Mar 12, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants