From 30d5761f66b4e9430827ae354738a37c4e8d8b30 Mon Sep 17 00:00:00 2001 From: "Thomas E. Enebo" Date: Thu, 4 Mar 2021 14:00:25 -0600 Subject: [PATCH] Enumerable#chunk should behave as a proc or lambda. not normal. --- core/src/main/java/org/jruby/RubyEnumerable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/jruby/RubyEnumerable.java b/core/src/main/java/org/jruby/RubyEnumerable.java index 3b281f322f0..3ca3563f72c 100644 --- a/core/src/main/java/org/jruby/RubyEnumerable.java +++ b/core/src/main/java/org/jruby/RubyEnumerable.java @@ -1989,7 +1989,8 @@ public static IRubyObject chunk(ThreadContext context, IRubyObject self, final B IRubyObject enumerator = runtime.getEnumerator().allocate(); enumerator.getInternalVariables().setInternalVariable("chunk_enumerable", self); - enumerator.getInternalVariables().setInternalVariable("chunk_categorize", RubyProc.newProc(runtime, block, block.type)); + enumerator.getInternalVariables().setInternalVariable("chunk_categorize", + RubyProc.newProc(runtime, block, block.type == Block.Type.LAMBDA ? block.type : Block.Type.PROC)); Helpers.invoke(context, enumerator, "initialize", CallBlock.newCallClosure(context, self, Signature.ONE_ARGUMENT,