Created
January 11, 2014 01:28
-
-
Save gcr/8365804 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 | |
| Tx=object | |
| foo: string | |
| proc destruct*(x: var Tx) {.destructor.}= | |
| echo "Destructing "&x.foo | |
| proc main_broken() = | |
| var y = Tx(foo:"y") | |
| var z = Tx(foo:"z") | |
| proc main_works() = | |
| var | |
| y = Tx(foo:"y") | |
| z = Tx(foo:"z") | |
| main_broken() | |
| echo "-------" | |
| main_works() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment