From 9ac8ba4e9aaed4737b8c441556f0ba685a2151ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 13 Oct 2023 23:43:48 +0200 Subject: [PATCH] TypeSystem::resolveRecursive(): Fix unresolved type variables being returned --- libsolidity/experimental/ast/TypeSystem.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libsolidity/experimental/ast/TypeSystem.cpp b/libsolidity/experimental/ast/TypeSystem.cpp index 2d252ad0ddfd..c3806dbc5c71 100644 --- a/libsolidity/experimental/ast/TypeSystem.cpp +++ b/libsolidity/experimental/ast/TypeSystem.cpp @@ -195,19 +195,19 @@ experimental::Type TypeEnvironment::resolve(Type _type) const experimental::Type TypeEnvironment::resolveRecursive(Type _type) const { return std::visit(util::GenericVisitor{ - [&](TypeConstant const& _type) -> Type { + [&](TypeConstant const& _typeConstant) -> Type { return TypeConstant{ - _type.constructor, - _type.arguments | ranges::views::transform([&](Type _argType) { + _typeConstant.constructor, + _typeConstant.arguments | ranges::views::transform([&](Type const& _argType) { return resolveRecursive(_argType); }) | ranges::to> }; }, - [&](TypeVariable const&) -> Type { - return _type; + [](TypeVariable const& _typeVar) -> Type { + return _typeVar; }, - [&](std::monostate) -> Type { - return _type; + [](std::monostate _nothing) -> Type { + return _nothing; } }, resolve(_type)); }