getTypeImpl now returns pragmas for object types (#9538)
This commit is contained in:
parent
e377c55c10
commit
69c0a9c6fb
2 changed files with 25 additions and 9 deletions
|
|
@ -183,3 +183,21 @@ test(Vec4[float32]):
|
|||
# bug #4862
|
||||
static:
|
||||
discard typedesc[(int, int)].getTypeImpl
|
||||
|
||||
# custom pragmas
|
||||
template myAttr() {.pragma.}
|
||||
template myAttr2() {.pragma.}
|
||||
template myAttr3() {.pragma.}
|
||||
template serializationKey(key: string) {.pragma.}
|
||||
|
||||
type
|
||||
MyObj = object {.packed,myAttr,serializationKey: "one".}
|
||||
myField {.myAttr2,serializationKey: "two".}: int
|
||||
myField2 {.myAttr3,serializationKey: "three".}: float
|
||||
|
||||
# field pragmas not currently supported
|
||||
test(MyObj):
|
||||
type
|
||||
_ = object {.packed,myAttr,serializationKey: "one".}
|
||||
myField: int
|
||||
myField2: float
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue