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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

Show comment
Hide comment
@kirillrdy

kirillrdy 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

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

This comment has been minimized.

Show comment
Hide comment
@MSNexploder

MSNexploder Apr 26, 2017

Contributor

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

Contributor

MSNexploder commented Apr 26, 2017

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

@fevin86

This comment has been minimized.

Show comment
Hide comment
@fevin86

fevin86 Apr 26, 2017

@MSNexploder you are right. Will close this

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