You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=copy and =sink cannot use a Uart[Init]. =destroy and =dup use the first Uart[T] defined even if the types do not match.
typeState=enumUninitInitUart[T: staticState] =object
baudRate: int
port: intproc`=destroy`(uart: varUart[Init]) =echo"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)procmain() =var a =Uart[Uninit]()
main()
Nim Version
2.0.2
Current Output
"Destroyed"
Expected Output
No response
Possible Solution
No response
Additional Information
Given the following uses the proper hooks it seems it's related to #22445 where the not using generic parameters results in two types being equivalent even though they certainly are not.
typeState=enumUninitInitUart[T: staticState] =object
baudRate: int
port: int
val: typeof(T)
proc`=destroy`(uart: varUart[Init]) =echo"Destroyed"proc`=destroy`(uart: varUart[Uninit]) =echo"Uninit'd"procmain() =var a =Uart[Uninit]()
main()
The text was updated successfully, but these errors were encountered:
Description
=copy
and=sink
cannot use aUart[Init]
.=destroy
and=dup
use the firstUart[T]
defined even if the types do not match.Nim Version
2.0.2
Current Output
Expected Output
No response
Possible Solution
No response
Additional Information
Given the following uses the proper hooks it seems it's related to #22445 where the not using generic parameters results in two types being equivalent even though they certainly are not.
The text was updated successfully, but these errors were encountered: