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

Banning copy for a type prevents composing #9692

alaviss opened this issue Nov 13, 2018 · 0 comments


None yet
2 participants
Copy link

commented Nov 13, 2018


  A = object
    a: int

func `=`(d: var A; s: A) {.error.}

  B = object
    a: A

var b: B

Current Output

Hint: used config file 'config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: test [Processing]
test.nim(12, 5) Error: usage of '=' is a user-defined error


Compiles successfully

Additional Information

Nim version:

Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2018-11-12
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: d2f7ecb80e8672f404fa59c9eb2249ffe72f5645
active boot switches: -d:release

@Araq Araq added the Destructors label Nov 15, 2018

@Araq Araq closed this in 3fe8b4f Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.