mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 20:14:44 +00:00
fix #1050
This commit is contained in:
16
tests/generics/t1050.nim
Normal file
16
tests/generics/t1050.nim
Normal file
@@ -0,0 +1,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)
|
||||
|
||||
Reference in New Issue
Block a user