summary refs log tree commit diff stats
path: root/tests/generics/t1050.nim
blob: a6f9a2482d12c6f759d1cf84032d1ac7c4094cb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  msg: "int"
  output: "4"
"""

import typetraits

type ArrayType[T] = distinct T

proc arrayItem(a: ArrayType): auto =
  static: echo(name(type(a).T))
  result = (type(a).T)(4)

var arr: ArrayType[int]
echo arrayItem(arr)