[ruby-core:93081] [Ruby trunk Bug#15467] Creating a class with a Cyrillic first symbol in the name leads to a SyntaxError in IRB
From:
merch-redmine@...
Date:
2019-06-12 22:54:27 UTC
List:
ruby-core #93081
Issue #15467 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Closed
This issue was fixed before 2.7.0-preview1:
```
$ irb27
irb(main):001:0> class Класс
irb(main):001:0> end
=> nil
irb(main):002:0> class ласс
irb(main):002:0> end
Traceback (most recent call last):
3: from /usr/local/bin/irb27:23:in `<main>'
2: from /usr/local/bin/irb27:23:in `load'
1: from /usr/local/lib/ruby/gems/2.7/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
SyntaxError ((irb):2: class/module name must be CONSTANT)
class ласс
^~~~~~~~
$ irb26
irb(main):001:0> class Класс
Traceback (most recent call last):
3: from /usr/local/bin/irb26:23:in `<main>'
2: from /usr/local/bin/irb26:23:in `load'
1: from /usr/local/lib/ruby/gems/2.6/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
SyntaxError ((irb):1: syntax error, unexpected end-of-input, expecting end)
```
----------------------------------------
Bug #15467: Creating a class with a Cyrillic first symbol in the name leads to a SyntaxError in IRB
https://bugs.ruby-lang.org/issues/15467#change-78497
* Author: an_vlad (Vladislav Andreev)
* Status: Closed
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version:
* ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
**What happens:** a syntax error occurs when a user writes `class Класс` and hits 'Enter' in IRB.
**What is expected to happen:** the same thing that happens when you create a class in IRB with `class SomeClass` line and hit 'Enter'.
**How to reproduce:**
1. Run IRB.
2. Write: `class Класс` and hit 'Enter'.
This leads to a syntax error: `unexpected end-of-input, expecting end`.
Some details:
- `class Класс; end` will successfully create a class.
- It seems like having a Cyrillic symbol as the first letter in a class name causes this error: `class ZКласс` works fine.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>