Project

General

Profile

Actions

Bug #9308

closed

def's return value causes errors

Added by phortx (Benjamin Kammerl) over 10 years ago. Updated about 10 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-linux]
[ruby-core:59342]

Description

It seems 2.1 hase some trouble with the "do" keyword in combination with the private/public/protected keywords and the def's return value:

Works: https://gist.github.com/phortx/8146341
Works Not: https://gist.github.com/phortx/8146345

$ ruby --version
ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-linux]

$ ruby works.rb
$ ruby works_not.rb
test.rb:5: syntax error, unexpected keyword_do_block, expecting keyword_end
test.rb:12: syntax error, unexpected keyword_end, expecting end-of-input


Related issues 2 (0 open2 closed)

Has duplicate Ruby master - Bug #9376: Passing do/end block inside decorated method fails, while passing {} block works.Closed01/07/2014Actions
Has duplicate Ruby master - Bug #9416: 'private def' results in syntax errors in the methodClosed01/15/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0