diff options
author | Mamy Ratsimbazafy <mamy_github@numforge.co> | 2023-05-30 04:46:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 10:46:24 +0800 |
commit | 171b916613bd0835ff3bf57061bd206a3df25f5e (patch) | |
tree | d9ef062b620f03ef538582b83c190f2a7b95d36d | |
parent | 244565397ddcd4af5a49b47b7874fe82e018e429 (diff) | |
download | Nim-171b916613bd0835ff3bf57061bd206a3df25f5e.tar.gz |
Add anti-regression for #21958 (#21960)
Add anti-regression test to close #21958
-rw-r--r-- | tests/generics/t21958.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/generics/t21958.nim b/tests/generics/t21958.nim new file mode 100644 index 000000000..f566b57cb --- /dev/null +++ b/tests/generics/t21958.nim @@ -0,0 +1,11 @@ +discard """ + action: compile +""" + +type + Ct*[T: SomeUnsignedInt] = distinct T + +template `shr`*[T: Ct](x: T, y: SomeInteger): T = T(T.T(x) shr y) + +var x: Ct[uint64] +let y {.used.} = x shr 2 \ No newline at end of file |