summary refs log tree commit diff stats
path: root/tests/generics/t21958.nim
blob: f566b57cbb9cfbca4a13bc1c85a30eed27d042c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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