The following code produces two NameErrors respectively
and they are independent, but the second one can show private constant message because of first NameError.
classCclassPrivateClass;endprivate_constant:PrivateClassendbegineval('class C::PrivateClass; end')rescue=>epeendbeginObject.const_get'Foo'rescue=>epeend#<NameError: private constant C::PrivateClass referenced>#<NameError: private constant C::Foo referenced>#=> should be #<NameError: uninitialized constant Foo>
It fails the test-all tests with make test-all TESTS='ruby/class ruby/parse --seed=58891 -v.
fix
NameErrormessageThe following code produces two NameErrors respectively
and they are independent, but the second one can show
private constantmessage because of first NameError.It fails the test-all tests with
make test-all TESTS='ruby/class ruby/parse --seed=58891 -v.The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a