parent
0149e418be
commit
367d232351
3 changed files with 27 additions and 1 deletions
19
tests/statictypes/texplicitprocparams.nim
Normal file
19
tests/statictypes/texplicitprocparams.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: '''
|
||||
(x: 100)
|
||||
5
|
||||
'''
|
||||
"""
|
||||
|
||||
type
|
||||
OdArray*[As: static[int], T] = object
|
||||
x: int
|
||||
|
||||
proc initOdArray*[As: static[int], T](len: int): OdArray[As, T] =
|
||||
result.l = len
|
||||
|
||||
echo initOdArray[10, int](100)
|
||||
|
||||
proc doStatic[N: static[int]](): int = N
|
||||
echo doStatic[5]()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue