mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
Add anti-regression test to close #21958
This commit is contained in:
committed by
GitHub
parent
244565397d
commit
171b916613
11
tests/generics/t21958.nim
Normal file
11
tests/generics/t21958.nim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user