Commit 79474b5
トップレベルの特異メソッドからのクラス変数アクセスの例外を実挙動に修正
トップレベルで定義した特異メソッド(Foo.a2)や class << Foo からのクラス
変数アクセスは NameError ではなく RuntimeError: class variable access
from toplevel になる。この挙動は Ruby 3.0 で導入されたもの(Bug #14541、
NEWS-3.0.0.md 「Additionally, accessing a class variable from the
toplevel scope is now a RuntimeError.」)で、るりまの対象範囲(3.0〜4.1)
全体で変わらないため無条件に修正した。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 684a58d commit 79474b5
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
0 commit comments