* GIWrapperInstance::typecheck_impl: * * See GIWrapperBase::typecheck(). Checks that the instance's wrapped * pointer is of the correct GType or GI info. Does not throw a JS * exception. * * It's possible to override typecheck_impl() if you need an extra step in * the check. */
| 1242 | * the check. |
| 1243 | */ |
| 1244 | [[nodiscard]] |
| 1245 | bool typecheck_impl(const GI::BaseInfo& expected_info) const { |
| 1246 | if constexpr (Prototype::may_not_have_info) { |
| 1247 | if (Base::info()) |
| 1248 | return Base::info().ref() == expected_info; |
| 1249 | } else { |
| 1250 | return Base::info() == expected_info; |
| 1251 | } |
| 1252 | return true; |
| 1253 | } |
| 1254 | [[nodiscard]] |
| 1255 | bool typecheck_impl(GType expected_gtype) const { |
| 1256 | g_assert(expected_gtype != G_TYPE_NONE && |