* Apply commit 5da931fe81 that was never merged (was part of a bigger PR). Should fix issue #11932
* add a generic object for custom pragma
This commit is contained in:
parent
927fa890ec
commit
1563cb2f6e
2 changed files with 16 additions and 1 deletions
|
|
@ -17,11 +17,21 @@ block:
|
|||
MyObj = object
|
||||
myField1, myField2 {.myAttr: "hi".}: int
|
||||
|
||||
MyGenericObj[T] = object
|
||||
myField1, myField2 {.myAttr: "hi".}: int
|
||||
|
||||
|
||||
var o: MyObj
|
||||
static:
|
||||
doAssert o.myField2.hasCustomPragma(myAttr)
|
||||
doAssert(not o.myField1.hasCustomPragma(myAttr))
|
||||
|
||||
var ogen: MyGenericObj[int]
|
||||
static:
|
||||
doAssert ogen.myField2.hasCustomPragma(myAttr)
|
||||
doAssert(not ogen.myField1.hasCustomPragma(myAttr))
|
||||
|
||||
|
||||
import custom_pragma
|
||||
block: # A bit more advanced case
|
||||
type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue