Created
February 3, 2013 17:07
-
-
Save gradha/4702621 to your computer and use it in GitHub Desktop.
Unexpected nimrod idetools behaviour on $data.str_val
This file contains 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 | |
Tparam_kind* = enum PK_EMPTY, PK_STRING | |
Tparsed_parameter* = object | |
case kind*: Tparam_kind | |
of PK_EMPTY: nil | |
of PK_STRING: str_val*: string | |
proc `$`*(data: Tparsed_parameter): string {.procvar.} = | |
case data.kind: | |
of PK_STRING: result = "\"" & $data.str_val & "\"" | |
else: nil | |
when isMainModule: | |
var a : Tparsed_parameter | |
a.kind = PK_STRING | |
a.str_val = "hey" | |
echo ($a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment