From 0ef08e49e74ca075f3dd7348791a77f00e5b3cab Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 28 Nov 2012 19:57:41 +0100 Subject: bugfix: better implict 'items' support --- tests/compile/titerovl.nim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/compile/titerovl.nim (limited to 'tests/compile/titerovl.nim') diff --git a/tests/compile/titerovl.nim b/tests/compile/titerovl.nim new file mode 100644 index 000000000..be665b2b7 --- /dev/null +++ b/tests/compile/titerovl.nim @@ -0,0 +1,21 @@ +discard """ + output: '''9 +1 +2 +3 +''' +""" + +# Test the new overloading rules for iterators: + +# test that iterator 'p' is preferred: +proc p(): seq[int] = @[1, 2, 3] +iterator p(): int = yield 9 + +for x in p(): echo x + +# test that 'q' works in this position: +proc q(): seq[int] = @[1, 2, 3] + +for x in q(): echo x + -- cgit 1.4.1-2-gfad0