From cae9a028a29594d77091ca3efaaddf82049d590c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 8 Jul 2021 12:01:40 +0200 Subject: [PATCH] Add type restriction to Iterator#each --- src/iterator.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iterator.cr b/src/iterator.cr index 45686cf8d112..179e5aac0493 100644 --- a/src/iterator.cr +++ b/src/iterator.cr @@ -590,7 +590,7 @@ module Iterator(T) # iter = ["a", "b", "c"].each # iter.each { |x| print x, " " } # Prints "a b c" # ``` - def each : Nil + def each(& : T -> _) : Nil while true value = self.next break if value.is_a?(Stop)