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
fevin86 opened this issue Mar 26, 2017 · 3 comments
Closed

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

fevin86 opened this issue Mar 26, 2017 · 3 comments
Milestone

Comments

@fevin86
Copy link

@fevin86 fevin86 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

@kirillrdy kirillrdy commented Apr 4, 2017

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

@MSNexploder MSNexploder commented Apr 26, 2017

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

@fevin86
Copy link
Author

@fevin86 fevin86 commented Apr 26, 2017

@MSNexploder you are right. Will close this

@fevin86 fevin86 closed this 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.