use 'using' instead of 'sig' keyword; cleans up new features a bit
This commit is contained in:
parent
554a3e9335
commit
c9966a3e17
20 changed files with 109 additions and 74 deletions
|
|
@ -3,5 +3,5 @@ discard """
|
|||
line: 6
|
||||
"""
|
||||
|
||||
let x = proc (x, y): auto = x + y
|
||||
let x = proc (x, y: auto): auto = x + y
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ proc foo[T](p: TType[T, range[0..2]]) =
|
|||
|
||||
#bug #1366
|
||||
|
||||
proc reversed(x) =
|
||||
proc reversed(x: auto) =
|
||||
for i in countdown(x.low, x.high):
|
||||
echo i
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ discard """
|
|||
proc test(x: proc (a, b: int): int) =
|
||||
echo x(5, 5)
|
||||
|
||||
test(proc (a, b): auto = a + b)
|
||||
test(proc (a, b: auto): auto = a + b)
|
||||
|
||||
test do (a, b) -> auto: a + b
|
||||
test do (a, b: auto) -> auto: a + b
|
||||
|
||||
proc foreach[T](s: seq[T], body: proc(x: T)) =
|
||||
for e in s:
|
||||
body(e)
|
||||
|
||||
foreach(@[1,2,3]) do (x):
|
||||
foreach(@[1,2,3]) do (x: auto):
|
||||
echo x
|
||||
|
||||
proc foo =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue