ruby-changes:38973
From: nobu <ko1@a...>
Date: Mon, 29 Jun 2015 02:11:25 +0900 (JST)
Subject: [ruby-changes:38973] nobu:r51055 (trunk): insns.def: preserve encoding
nobu 2015-06-29 02:10:26 +0900 (Mon, 29 Jun 2015) New Revision: 51055 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51055 Log: insns.def: preserve encoding * insns.def (defineclass): preserve encoding of name in error messages for super class mismatch. Modified files: trunk/ChangeLog trunk/insns.def trunk/test/ruby/test_class.rb Index: insns.def =================================================================== --- insns.def (revision 51054) +++ insns.def (revision 51055) @@ -869,8 +869,8 @@ defineclass https://github.com/ruby/ruby/blob/trunk/insns.def#L869 tmp = rb_class_real(RCLASS_SUPER(klass)); if (tmp != super) { - rb_raise(rb_eTypeError, "superclass mismatch for class %s", - rb_id2name(id)); + rb_raise(rb_eTypeError, "superclass mismatch for class % "PRIsVALUE"", + rb_id2str(id)); } } } Index: ChangeLog =================================================================== --- ChangeLog (revision 51054) +++ ChangeLog (revision 51055) @@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 -Mon Jun 29 02:08:01 2015 Nobuyoshi Nakada <nobu@r...> +Mon Jun 29 02:10:10 2015 Nobuyoshi Nakada <nobu@r...> + + * insns.def (defineclass): preserve encoding of name in error + messages for super class mismatch. * insns.def (defineclass): preserve encoding of name in error messages for non-class super. Index: test/ruby/test_class.rb =================================================================== --- test/ruby/test_class.rb (revision 51054) +++ test/ruby/test_class.rb (revision 51055) @@ -369,6 +369,9 @@ class TestClass < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_class.rb#L369 end end; } + assert_raise_with_message(TypeError, /#{n}/) { + m.module_eval "class #{n} < Class.new; end" + } end def test_cloned_singleton_method_added -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/