summary refs log tree commit diff stats
path: root/tests/pragmas
diff options
context:
space:
mode:
authorRegis Caillaud <35006197+Clonkk@users.noreply.github.com>2022-01-20 20:50:36 +0100
committerGitHub <noreply@github.com>2022-01-20 20:50:36 +0100
commit1563cb2f6e37f07c303d095dabde74955be1e523 (patch)
tree5caabb8a28b4d2e09e39bb46ab1a2587a799ca7c /tests/pragmas
parent927fa890ec91cf13d7e3aa87267b994c2812bdc8 (diff)
downloadNim-1563cb2f6e37f07c303d095dabde74955be1e523.tar.gz
Fix #11923 (#19427)
* Apply commit https://github.com/nim-lang/Nim/commit/5da931fe811717a45f2dd272ea6281979c3e8f0b that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma
Diffstat (limited to 'tests/pragmas')
-rw-r--r--tests/pragmas/tcustom_pragma.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pragmas/tcustom_pragma.nim b/tests/pragmas/tcustom_pragma.nim
index b197a7c55..1c3709b26 100644
--- a/tests/pragmas/tcustom_pragma.nim
+++ b/tests/pragmas/tcustom_pragma.nim
@@ -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