Skip to content

Commit e498592

Browse files
committed
compatible fixes for Nim devel version
1 parent 63a91ab commit e498592

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

struct.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,14 @@ proc add*(s: var Struct, d: float) {.inline.} =
476476
proc add*(s: var Struct, str: string) {.inline.} =
477477
s.vars.add(newStructString(str))
478478

479-
macro pack_m(n: openarray[expr]): stmt =
479+
macro pack_m(n: openarray[typed]): untyped =
480480
result = newNimNode(nnkStmtList, n)
481481
result.add(newCall("initStruct", ident("s"), n[0]))
482482
if n.len > 1:
483483
for i in 1..n.len-1:
484484
result.add(newCall(ident("add"), ident("s"), n[i]))
485485

486-
template `pack`*(n: varargs[expr]): expr =
486+
template `pack`*(n: varargs[typed]): untyped =
487487
when not declaredInScope(s):
488488
var s {.inject.}: Struct
489489
pack_m(n)

struct.nimble

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Package]
22
name = "struct"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
author = "Huy Doan"
55
description = "Python-like 'struct' for Nim"
66
license = "MIT"

0 commit comments

Comments
 (0)