Project

General

Profile

Bug #9416

'private def' results in syntax errors in the method

Added by rits (First Last) over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

class Class1
  private def foo
    [1, 2].each do |e|
      p e
    end
  end
end

Class1.new.send :foo

syntax error, unexpected keyword_do_block, expecting keyword_end
    [1, 2].each do |e|
                  ^

Related issues

Is duplicate of Ruby trunk - Bug #9308: def's return value causes errorsClosed2013-12-27

Associated revisions

Revision 02cc3d94
Added by naruse (Yui NARUSE) over 4 years ago

merge revision(s) 44449: [Backport #9416]

* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
  isolate command argument state from outer scope.
   [Bug #9308]

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

History

#1 Updated by rits (First Last) over 4 years ago

same with private_class_method def self.foo

#2 Updated by phasis68 (Heesob Park) over 4 years ago

This issue was solved with changeset r44449.
But not yet backported to 2.1.0.

Refer to https://bugs.ruby-lang.org/issues/9308

#3 Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Is duplicate of Bug #9308: def's return value causes errors added

#4 Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Open to Closed

#5 Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Description updated (diff)

#6 Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • ruby -v changed from ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux] to -

Issue #9416 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed


Bug #9416: 'private def' results in syntax errors in the method
https://bugs.ruby-lang.org/issues/9416#change-44335

  • Author: First Last
  • Status: Closed
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
  • Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- class Class1 private def foo [1, 2].each do |e| p e end end end

Class1.new.send :foo


syntax error, unexpected keyword_do_block, expecting keyword_end
[1, 2].each do |e|
^

--
http://bugs.ruby-lang.org/

#7 Updated by nobu (Nobuyoshi Nakada) over 4 years ago

Issue #9416 has been updated by Nobuyoshi Nakada.

Description updated


Bug #9416: 'private def' results in syntax errors in the method
https://bugs.ruby-lang.org/issues/9416#change-44336

  • Author: First Last
  • Status: Closed
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
  • Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- ``` class Class1 private def foo [1, 2].each do |e| p e end end end

Class1.new.send :foo

 _______________________________

syntax error, unexpected keyword_do_block, expecting keyword_end
[1, 2].each do |e|
^



 -- 
 http://bugs.ruby-lang.org/

#8 [ruby-core:60476] Updated by usa (Usaku NAKAMURA) over 4 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONE, 2.0.0: REQUIRED, 2.1: REQUIRED

#9 [ruby-core:60621] Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Backport changed from 1.9.3: DONE, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED

r44449 was backported to ruby_2_0_0 branch at r44898.

#10 [ruby-core:60950] Updated by naruse (Yui NARUSE) over 4 years ago

  • Backport changed from 1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: DONE, 2.1: DONE

r45086.

Also available in: Atom PDF