Skip to content

Noncopyable base type ignored #24760

Open
@arnetheduck

Description

@arnetheduck

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions