diff options
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-coercion.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-tyty-coercion.h b/gcc/rust/typecheck/rust-tyty-coercion.h index e13c7f8..c862de5 100644 --- a/gcc/rust/typecheck/rust-tyty-coercion.h +++ b/gcc/rust/typecheck/rust-tyty-coercion.h @@ -856,6 +856,18 @@ public: TyVar (base_resolved->get_ref ())); } + void visit (InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCoercionRules::visit (type); + return; + } + + resolved = base->clone (); + resolved->set_ref (type.get_ref ()); + } + private: BaseType *get_base () override { return base; } @@ -902,6 +914,18 @@ public: TyVar (base_resolved->get_ref ())); } + void visit (InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCoercionRules::visit (type); + return; + } + + resolved = base->clone (); + resolved->set_ref (type.get_ref ()); + } + private: BaseType *get_base () override { return base; } |