Skip to content

Unicode chars in method names aren't accepted #3778

@jodosha

Description

@jodosha

Environment

JRuby version:

jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-04-01 30c1276 Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [darwin-x86_64]

OS:

Darwin escher 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

Expected Behavior

Unicode chars in method names should be accepted.

I discovered this issue with hanami-utils and patched it to make the build to pass with 9.0.0.0.

According to @enebo, this supposed to be fixed with nightly series, but it isn't the case.

MRI/expected behavior:

irb(main):001:0> RUBY_VERSION
=> "2.3.0"
irb(main):002:0> def тест
irb(main):003:1> puts "hi"
irb(main):004:1> end
=> :тест
irb(main):005:0> тест
hi
=> nil

Actual Behavior

irb(main):001:0> RUBY_VERSION
=> "2.3.0"
irb(main):002:0> def тест
irb(main):003:1> puts "hi"
irb(main):004:1> end
=> :????
irb(main):005:0> тест
NameError: uninitialized constant B5AB
    from org/jruby/RubyModule.java:3238:in `const_missing'
    from (irb):5:in `<eval>'
    from org/jruby/RubyKernel.java:983:in `eval'
    from org/jruby/RubyKernel.java:1290:in `loop'
    from org/jruby/RubyKernel.java:1103:in `catch'
    from org/jruby/RubyKernel.java:1103:in `catch'
    from /Users/luca/.rubies/jruby-9.1.0.0-SNAPSHOT/bin/irb:13:in `<top>'
irb(main):006:0> __send__(:тест)
hi
=> nil
irb(main):007:0> __send__("тест")
NoMethodError: undefined method `тест' for main:Object
    from (irb):7:in `<eval>'
    from org/jruby/RubyKernel.java:983:in `eval'
    from org/jruby/RubyKernel.java:1290:in `loop'
    from org/jruby/RubyKernel.java:1103:in `catch'
    from org/jruby/RubyKernel.java:1103:in `catch'
    from /Users/luca/.rubies/jruby-9.1.0.0-SNAPSHOT/bin/irb:13:in `<top>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions