Clonkk fix2 11923 (#19451)

* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas
This commit is contained in:
Regis Caillaud
2022-02-02 09:44:51 +01:00
committed by GitHub
parent 1830a3b505
commit 486cb09ec2
2 changed files with 28 additions and 5 deletions

View File

@@ -20,16 +20,22 @@ block:
MyGenericObj[T] = object
myField1, myField2 {.myAttr: "hi".}: int
MyOtherObj = MyObj
var o: MyObj
static:
doAssert o.myField2.hasCustomPragma(myAttr)
doAssert(not o.myField1.hasCustomPragma(myAttr))
doAssert(not o.myField1.hasCustomPragma(MyObj))
doAssert(not o.myField1.hasCustomPragma(MyOtherObj))
var ogen: MyGenericObj[int]
static:
doAssert ogen.myField2.hasCustomPragma(myAttr)
doAssert(not ogen.myField1.hasCustomPragma(myAttr))
doAssert(not ogen.myField1.hasCustomPragma(MyGenericObj))
doAssert(not ogen.myField1.hasCustomPragma(MyGenericObj))
import custom_pragma