diff options
author | Araq <rumpf_a@web.de> | 2011-04-01 15:07:16 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-04-01 15:07:16 +0200 |
commit | 4741e8f9a1d1148d58e129626952219e14ede255 (patch) | |
tree | db2eca2249ccc3230dc6c0a7359986198cab4048 /tests/accept/compile/tconstraints.nim | |
parent | dc669155e39007f1b584eef247dff90523f836bf (diff) | |
download | Nim-4741e8f9a1d1148d58e129626952219e14ede255.tar.gz |
ugh, maybe broke git
Diffstat (limited to 'tests/accept/compile/tconstraints.nim')
-rw-r--r-- | tests/accept/compile/tconstraints.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/accept/compile/tconstraints.nim b/tests/accept/compile/tconstraints.nim new file mode 100644 index 000000000..7aef0d645 --- /dev/null +++ b/tests/accept/compile/tconstraints.nim @@ -0,0 +1,15 @@ + + +proc myGenericProc[T: object|tuple|int|ptr|ref|distinct](x: T): string = + result = $x + +type + TMyObj = tuple[x, y: int] + +var + x: TMyObj + +assert myGenericProc(232) == "232" +assert myGenericProc(x) == "(x: 0, y: 0)" + + |