summary refs log tree commit diff stats
path: root/tests/distinct/tcomplexaddressableconv.nim
blob: 00e96bfeb79f32e8e3623cd55ee5b8e67f7696ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# issue #22523

from std/typetraits import distinctBase

type
  V[p: static int] = distinct int
  D[p: static int] = distinct int
  T = V[1]

proc f(y: var T) = discard

var a: D[0]

static:
  doAssert distinctBase(T) is distinctBase(D[0])
  doAssert distinctBase(T) is int
  doAssert distinctBase(D[0]) is int
  doAssert T(a) is T

f(cast[ptr T](addr a)[])
f(T(a))