closes #23394; adds a test case (#25416)

closes #23394
This commit is contained in:
ringabout
2026-01-07 16:32:25 +08:00
committed by GitHub
parent d3be5e5e13
commit 89c8f0aa49

19
tests/arc/tgenerics.nim Normal file
View File

@@ -0,0 +1,19 @@
discard """
matrix: "--mm:refc"
"""
type
State = enum
Uninit
Init
Uart[T: static State] = object
baudRate: int
port: int
proc `=destroy`(uart: var Uart[Init]) = raiseAssert "Destroyed"
# proc `=copy`(a: var Uart[Init], b: Uart[Init]) {.error.} # Error: signature for '=copy' must be proc[T: object](x: var T; y: T)
proc main() =
var a = Uart[Uninit]()
main()