From 4741e8f9a1d1148d58e129626952219e14ede255 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 1 Apr 2011 15:07:16 +0200 Subject: ugh, maybe broke git --- tests/reject/tconstraints.nim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/reject/tconstraints.nim (limited to 'tests/reject/tconstraints.nim') diff --git a/tests/reject/tconstraints.nim b/tests/reject/tconstraints.nim new file mode 100644 index 000000000..aafe86911 --- /dev/null +++ b/tests/reject/tconstraints.nim @@ -0,0 +1,18 @@ +discard """ + line: 15 + errormsg: "type mismatch: got (int)" +""" + +proc myGenericProc[T: object|tuple|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)" + + -- cgit 1.4.1-2-gfad0