{
TyTy::BaseType *candidate_type = candidate.candidate.ty;
rust_assert (candidate_type->get_kind () == TyTy::TypeKind::FNDEF);
+ if (candidate_type == nullptr
+ || candidate_type->get_kind () != TyTy::TypeKind::FNDEF)
+ continue;
TyTy::FnType &fn = *static_cast<TyTy::FnType *> (candidate_type);
// match the number of arguments
TyTy::BaseType *ty = nullptr;
if (!query_type (func->get_mappings ().get_hirid (), &ty))
return true;
- rust_assert (ty != nullptr);
- if (ty->get_kind () == TyTy::TypeKind::ERROR)
+ if (ty == nullptr || ty->get_kind () == TyTy::TypeKind::ERROR)
+ return true;
+ if (ty->get_kind () != TyTy::TypeKind::FNDEF)
return true;
- rust_assert (ty->get_kind () == TyTy::TypeKind::FNDEF);
TyTy::FnType *fnty = static_cast<TyTy::FnType *> (ty);
const TyTy::BaseType *impl_self
= TypeCheckItem::ResolveImplBlockSelf (*impl);
TyTy::BaseType *ty = nullptr;
if (!query_type (func->get_mappings ().get_hirid (), &ty))
continue;
- if (ty->get_kind () == TyTy::TypeKind::ERROR)
+ if (ty == nullptr || ty->get_kind () == TyTy::TypeKind::ERROR)
+ continue;
+ if (ty->get_kind () != TyTy::TypeKind::FNDEF)
continue;
- rust_assert (ty->get_kind () == TyTy::TypeKind::FNDEF);
TyTy::FnType *fnty = static_cast<TyTy::FnType *> (ty);
const TyTy::BaseType *impl_self
= TypeCheckItem::ResolveImplBlockSelf (*impl);
return true;
TyTy::BaseType *ty = item_ref->get_tyty ();
- rust_assert (ty->get_kind () == TyTy::TypeKind::FNDEF);
+ if (ty == nullptr || ty->get_kind () != TyTy::TypeKind::FNDEF)
+ return true;
TyTy::FnType *fnty = static_cast<TyTy::FnType *> (ty);
trait_candidates.emplace_back (func, trait, fnty, trait_ref, item_ref);
for (const auto &predicate : predicate_items)
{
const TyTy::FnType *fn = predicate.fntype;
- rust_assert (fn->is_method ());
+ if (!fn->is_method ())
+ continue;
TyTy::BaseType *fn_self = fn->get_self_type ();
rust_debug ("dot-operator predicate fn_self={%s} can_eq receiver={%s}",
continue;
TyTy::FnType *fn = impl_item.ty;
- rust_assert (fn->is_method ());
+ if (!fn->is_method ())
+ continue;
TyTy::BaseType *fn_self = fn->get_self_type ();
for (auto trait_item : candidates)
{
TyTy::FnType *fn = trait_item.ty;
- rust_assert (fn->is_method ());
+ if (!fn->is_method ())
+ continue;
TyTy::BaseType *fn_self = fn->get_self_type ();
rust_debug ("dot-operator trait_item fn_self={%s} can_eq receiver={%s}",