mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 04:02:41 +00:00
17 lines
236 B
Nim
17 lines
236 B
Nim
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)
|
|
|