From: matz@... Date: 2020-06-18T05:36:02+00:00 Subject: [ruby-core:98855] [Ruby master Bug#16504] `foo(*args, &args.pop)` should pass all elements of args Issue #16504 has been updated by matz (Yukihiro Matsumoto). Accepted. We can ignore incompatibility here. Matz. ---------------------------------------- Bug #16504: `foo(*args, &args.pop)` should pass all elements of args https://bugs.ruby-lang.org/issues/16504#change-86217 * Author: mame (Yusuke Endoh) * Status: Open * Priority: Normal * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- https://bugs.ruby-lang.org/issues/16500?next_issue_id=16499&prev_issue_id=16501#note-7 ``` def foo(*args) p args end # in 2.7 args = [1, 2, -> {}]; foo( *args, &args.pop) #=> passes [1, 2] (bug; [1, 2, ->{}] is expected) args = [1, 2, -> {}]; foo(0, *args, &args.pop) #=> passes [0, 1, 2, ->{}] (good) ``` -- https://bugs.ruby-lang.org/ Unsubscribe: