--f46d0417061f52ed8004b61804ee
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 9, 2012 at 12:43, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:

> In message "Re: [ruby-core:41997] [ruby-trunk - Bug #5865] Exception#== should return false if the classes differ"
>  on Mon, 9 Jan 2012 15:10:16 +0900, Hiro Asari <asari.ruby / gmail.com> writes:
> |
> |Issue #5865 has been updated by Hiro Asari.
> |
> |Can this be assigned to matz for clarification?
>
> See [ruby-dev:34808].

What”Ēs the use case?  (How often do you wrap an Exception in a SimpleDelegator?)

The fix should be to also check the #class of obj against the #class
of exc, not to simply ignore it if the rb_obj_class()es don”Ēt match.
I”Ēve attached a patch.

SimpleDelegator would then need to delegate class as well, but I can”Ēt
say whether that makes sense or not.

--f46d0417061f52ed8004b61804ee
Content-Type: application/octet-stream; name="exc_equal.patch"
Content-Disposition: attachment; filename="exc_equal.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gx7i2rxz0

ZGlmZiAtLWdpdCBhL2Vycm9yLmMgYi9lcnJvci5jCmluZGV4IDY4NDRmOTkuLjVlNGVjZDQgMTAw
NjQ0Ci0tLSBhL2Vycm9yLmMKKysrIGIvZXJyb3IuYwpAQCAtNzMyLDEwICs3MzIsMTYgQEAgZXhj
X2VxdWFsKFZBTFVFIGV4YywgVkFMVUUgb2JqKQogICAgIENPTlNUX0lEKGlkX21lc2csICJtZXNn
Iik7CiAKICAgICBpZiAocmJfb2JqX2NsYXNzKGV4YykgIT0gcmJfb2JqX2NsYXNzKG9iaikpIHsK
LQlJRCBpZF9tZXNzYWdlLCBpZF9iYWNrdHJhY2U7CisgICAgICAgIFZBTFVFIGtsYXNzOworCUlE
IGlkX2NsYXNzLCBpZF9tZXNzYWdlLCBpZF9iYWNrdHJhY2U7CisgICAgICAgIENPTlNUX0lEKGlk
X2NsYXNzLCAiY2xhc3MiKTsKIAlDT05TVF9JRChpZF9tZXNzYWdlLCAibWVzc2FnZ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