diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-14 10:14:51 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-14 23:11:58 +0900 |
commit | edd27e120eca13be1754d4111dfc3cf2ab2f99f8 (patch) | |
tree | 6d48dd5af0445211bd828eb5c130a7ffc6259d97 /error.c | |
parent | d58620e0a1d03518a5cb49b954008d70ac7898d2 (diff) |
A comment for typed data in `rb_check_type` [ci skip]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4741
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1007,6 +1007,14 @@ rb_check_type(VALUE x, int t) xt = TYPE(x); if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) { + /* + * Typed data is not simple `T_DATA`, but in a sense an + * extension of `struct RVALUE`, which are incompatible with + * each other except when inherited. + * + * So it is not enough to just check `T_DATA`, it must be + * identified by its `type` using `Check_TypedStruct` instead. + */ unexpected_type(x, xt, t); } } |