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
commit 486cb09ec2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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