diff --git a/libsolidity/experimental/analysis/TypeInference.cpp b/libsolidity/experimental/analysis/TypeInference.cpp index 2e5a35853..d326d01ca 100644 --- a/libsolidity/experimental/analysis/TypeInference.cpp +++ b/libsolidity/experimental/analysis/TypeInference.cpp @@ -839,7 +839,7 @@ bool TypeInference::visit(TypeDefinition const& _typeDefinition) TypeConstructor constructor = typeConstructor(&_typeDefinition); auto [members, newlyInserted] = annotation().members.emplace(constructor, std::map{}); - solAssert(newlyInserted); + solAssert(newlyInserted, fmt::format("Members of type '{}' are already defined.", m_typeSystem.constructorInfo(constructor).name)); if (underlyingType) { members->second.emplace("abs", TypeMember{helper.functionType(*underlyingType, definedType)}); diff --git a/libsolidity/experimental/ast/TypeSystem.cpp b/libsolidity/experimental/ast/TypeSystem.cpp index 0400f4196..717ecd4fe 100644 --- a/libsolidity/experimental/ast/TypeSystem.cpp +++ b/libsolidity/experimental/ast/TypeSystem.cpp @@ -297,7 +297,10 @@ experimental::Type TypeSystem::type(TypeConstructor _constructor, std::vector