tcomplexaddressableconv.nim 366 B

12345678910111213141516171819202122
  1. # issue #22523
  2. from std/typetraits import distinctBase
  3. type
  4. V[p: static int] = distinct int
  5. D[p: static int] = distinct int
  6. T = V[1]
  7. proc f(y: var T) = discard
  8. var a: D[0]
  9. static:
  10. doAssert distinctBase(T) is distinctBase(D[0])
  11. doAssert distinctBase(T) is int
  12. doAssert distinctBase(D[0]) is int
  13. doAssert T(a) is T
  14. f(cast[ptr T](addr a)[])
  15. f(T(a))