style fixes

This commit is contained in:
Daniel Kirchner 2023-08-22 17:56:26 +02:00 committed by Nikola Matic
parent 43ca0f0947
commit f7cbddb7d5
12 changed files with 126 additions and 127 deletions

View File

@ -791,9 +791,7 @@ experimental::Type TypeInference::memberType(Type _type, std::string _memberName
{
auto constructor = std::get<0>(helper.destTypeConstant(type));
if (auto* typeMember = util::valueOrNullptr(annotation().members.at(constructor), _memberName))
{
return polymorphicInstance(typeMember->type);
}
else
{
m_errorReporter.typeError(0000_error, _location, fmt::format("Member {} not found in type {}.", _memberName, TypeEnvironmentHelpers{*m_env}.typeToString(_type)));

View File

@ -133,7 +133,7 @@ TypeSystem::TypeSystem()
m_primitiveTypeClasses.emplace(PrimitiveClass::Type, declarePrimitiveClass("type"));
for (auto [type, name, arity]: std::initializer_list<std::tuple<PrimitiveType, const char*, uint64_t>> {
for (auto [type, name, arity]: std::initializer_list<std::tuple<PrimitiveType, char const*, uint64_t>>{
{PrimitiveType::TypeFunction, "tfun", 2},
{PrimitiveType::Function, "fun", 2},
{PrimitiveType::Function, "itself", 1},

View File

@ -46,7 +46,8 @@ std::string IRGeneratorForStatements::generate(ASTNode const& _node)
}
namespace {
namespace
{
struct CopyTranslate: public yul::ASTCopier
{