Last active
November 14, 2018 17:14
-
-
Save brentp/e45ab693d4c25881172d2066d63b8717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Signal* = object | |
left*: uint32 | |
right*: uint32 | |
left_exact* {.bitsize: 1.}: uint32 | |
right_exact* {.bitsize: 1.}: uint32 | |
when defined(debug): | |
name*: string | |
proc makeSignal(): Signal = | |
result.left_exact = 1'u32 | |
doAssert makeSignal().left_exact == 1 | |
var b = makeSignal() | |
#OK | |
doAssert b.left_exact == 1 | |
var c = b | |
# FAIL. | |
doAssert c.left_exact == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment