Project

General

Profile

Bug #15786

numbered parameterを使ったprocのparametersに記号が現れる

Added by tompng (tomoya ishida) 8 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-04-23 trunk f4f66bd11c) [x86_64-darwin17]
[ruby-core:92384]

Description

->{@100}.parameters.map{@2}.join
#=> "!\"\#$%&'()*+,-./:;<=>?@[\\]^`"

proc{@100}.parameters の場合はそれに加え、[[:opt, nil]...] になる

RubyVM::InstructionSequence.of(->{@100}).to_a
RubyVM::InstructionSequence.disasm(->{@100})
にも同様の記号が混ざる

lambda{@100}.parameters[[:req]]*100
proc{@100}.parameters[[:opt, nil]]*100ではなく[[:opt]]*100
になると良いのではないかと思います。(1.method(:+).parameters #=> [[:req]] とnilは含まれないのでそれに合わせて)

Associated revisions

Revision 41d6bc37
Added by nagachika (Tomoyuki Chikanaga) 5 months ago

merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]

    Add RB_ID_SERIAL_MAX


    Hide internal IDs

    * parse.y (internal_id): number the ID serial for internal use by
      counting down from the neary maximum value, not to accidentally
      match permanent IDs.

    [Bug #15768]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67718
Added by nagachika (Tomoyuki Chikanaga) 5 months ago

merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]

Add RB_ID_SERIAL_MAX


Hide internal IDs

* parse.y (internal_id): number the ID serial for internal use by
  counting down from the neary maximum value, not to accidentally
  match permanent IDs.

[Bug #15768]

Revision 401da791
Added by usa (Usaku NAKAMURA) 4 months ago

merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]

    Add RB_ID_SERIAL_MAX


    Hide internal IDs

    * parse.y (internal_id): number the ID serial for internal use by
      counting down from the neary maximum value, not to accidentally
      match permanent IDs.

    [Bug #15768]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67758
Added by usa (Usaku NAKAMURA) 4 months ago

merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]

Add RB_ID_SERIAL_MAX


Hide internal IDs

* parse.y (internal_id): number the ID serial for internal use by
  counting down from the neary maximum value, not to accidentally
  match permanent IDs.

[Bug #15768]

History

#2

Updated by nobu (Nobuyoshi Nakada) 8 months ago

  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) 5 months ago

  • Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67718 merged revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e.

Updated by usa (Usaku NAKAMURA) 4 months ago

  • Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE to 2.4: REQUIRED, 2.5: DONE, 2.6: DONE

ruby_2_5 r67758 merged revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e.

Also available in: Atom PDF