use 'using' instead of 'sig' keyword; cleans up new features a bit

This commit is contained in:
Andreas Rumpf
2016-02-29 12:19:54 +01:00
parent 554a3e9335
commit c9966a3e17
20 changed files with 109 additions and 74 deletions

View File

@@ -0,0 +1,39 @@
discard """
output: '''0 -2 0
0 -2'''
"""
{.this: self.}
type
Foo {.partial.} = object
a, b: int
type
tupcomingfeatures.Foo = object
x: int
proc yay(self: Foo) =
echo a, " ", b, " ", x
proc footest[T](self: var Foo, a: T) =
b = 1+a
yay()
proc nongeneric(self: Foo) =
echo a, " ", b
var ff: Foo
footest(ff, -3)
ff.nongeneric
{.experimental.}
using
c: Foo
x, y: int
proc usesSig(c) =
echo "yummy"
proc foobar(c, y) =
echo "yay"