# Bug in ruby 2.1.0 interpreter?

**URL:** <https://www.ruby-forum.com/t/bug-in-ruby-2-1-0-interpreter/238340>\
**Category:** Ruby\
**Created:** [January 5, 2014, 3:25am UTC](https://www.ruby-forum.com/t/bug-in-ruby-2-1-0-interpreter/238340 "2014-01-05T03:25:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 5, 2014, 3:25am UTC](https://www.ruby-forum.com/t/bug-in-ruby-2-1-0-interpreter/238340/1 "2014-01-05T03:25:49Z")

</div>

Hello everybody,

I’m upgrading some apps to 2.1.0, and on one file, I decide to refactor  
a  
little to use the new 2.1.0 feature, the def returning the symbol of the  
created method, coupling with « private ».  
But I meet an error during ruby interpretation, which confuse me a lot.

After struggle myself on this ununderstandable error, I discover the  
problem  
and I write a minimal test-case to recreate the behaviour :  
[http://short.imirhil.fr/2](http://short.imirhil.fr/2)

Am I wrong somewhere or this file must be totally valid ?  
Seems coupling private/def-sym with do/end block confuse the  
interpretor…  
Do I have to open a bug ticket for this ?

Regards,

---

<div class="post-metadata">

**Author:** ![Aeris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@Aeris](https://www.ruby-forum.com/u/Aeris)\
**Post date:** [January 5, 2014, 3:35am UTC](https://www.ruby-forum.com/t/bug-in-ruby-2-1-0-interpreter/238340/2 "2014-01-05T03:35:11Z")

</div>

Hi,

2014/1/5 Aeris [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Am I wrong somewhere or this file must be totally valid ?  
> Seems coupling private/def-sym with do/end block confuse the interpretor…  
> Do I have to open a bug ticket for this ?

The above bug was already reported and fixed in trunk version.

> **[Bug #9308: def's return value causes errors - Ruby - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/9308)**
>
> Redmine

But not yet backported to Ruby 2.1.0

Regards,  
Park H.
