Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol encoding changes after defining a method with same name #4547

Closed
y-f-u opened this issue Mar 26, 2017 · 3 comments
Closed

Symbol encoding changes after defining a method with same name #4547

y-f-u opened this issue Mar 26, 2017 · 3 comments
Milestone

Comments

@y-f-u
Copy link

y-f-u commented Mar 26, 2017

Environment

Provide at least:

  • JRuby-9.1.8.0
  • OSX, Fedora...

Expected Behavior

a = :something
a.encoding # #<Encoding:US-ASCII>
def something; end
a.encoding # should be #<Encoding:US-ASCII>

Actual Behavior

a = :something
a.encoding # #<Encoding:US-ASCII>
def something; end
a.encoding # it is now #<Encoding:ASCII-8BIT>
@kirillrdy
Copy link

Can I also add some comments about reproducing @fevin86 bug
you need to evaluate the return of def, eg puts it

a = :something
a.encoding # #<Encoding:US-ASCII>
puts def something; end
a.encoding # should be #<Encoding:US-ASCII>

the example he posted works if you paste it into irb, because irb evals return value of each line

@MSNexploder
Copy link
Contributor

Should be the same issue as #4564 (fixed in 01cd84d).

@y-f-u
Copy link
Author

y-f-u commented Apr 26, 2017

@MSNexploder you are right. Will close this

@y-f-u y-f-u closed this as completed Apr 26, 2017
@enebo enebo added this to the JRuby 9.1.9.0 milestone May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants