diff --git a/libsolidity/experimental/ast/Type.h b/libsolidity/experimental/ast/Type.h index f98925684..dde41b1df 100644 --- a/libsolidity/experimental/ast/Type.h +++ b/libsolidity/experimental/ast/Type.h @@ -17,6 +17,7 @@ // SPDX-License-Identifier: GPL-3.0 #pragma once +#include #include #include #include @@ -86,8 +87,8 @@ public: } private: friend class TypeSystem; - TypeConstructor(size_t _index): m_index(_index) {} - size_t m_index = 0; + TypeConstructor(std::size_t _index): m_index(_index) {} + std::size_t m_index = 0; }; struct TypeConstant @@ -119,8 +120,8 @@ public: } private: friend class TypeSystem; - TypeClass(size_t _index): m_index(_index) {} - size_t m_index = 0; + TypeClass(std::size_t _index): m_index(_index) {} + std::size_t m_index = 0; }; struct Sort @@ -141,13 +142,13 @@ struct Arity struct TypeVariable { - size_t index() const { return m_index; } + std::size_t index() const { return m_index; } Sort const& sort() const { return m_sort; } private: friend class TypeSystem; - size_t m_index = 0; + std::size_t m_index = 0; Sort m_sort; - TypeVariable(size_t _index, Sort _sort): m_index(_index), m_sort(std::move(_sort)) {} + TypeVariable(std::size_t _index, Sort _sort): m_index(_index), m_sort(std::move(_sort)) {} }; } diff --git a/libsolidity/experimental/ast/TypeSystem.cpp b/libsolidity/experimental/ast/TypeSystem.cpp index e6e65a110..5347b3d15 100644 --- a/libsolidity/experimental/ast/TypeSystem.cpp +++ b/libsolidity/experimental/ast/TypeSystem.cpp @@ -32,6 +32,8 @@ #include +#include + using namespace solidity; using namespace solidity::frontend; using namespace solidity::frontend::experimental; @@ -133,7 +135,7 @@ TypeSystem::TypeSystem() m_primitiveTypeClasses.emplace(PrimitiveClass::Type, declarePrimitiveClass("type")); - for (auto [type, name, arity]: std::initializer_list>{ + for (auto [type, name, arity]: std::initializer_list>{ {PrimitiveType::TypeFunction, "tfun", 2}, {PrimitiveType::Function, "fun", 2}, {PrimitiveType::Function, "itself", 1}, @@ -157,7 +159,7 @@ TypeSystem::TypeSystem() experimental::Type TypeSystem::freshVariable(Sort _sort) { - uint64_t index = m_numTypeVariables++; + size_t index = m_numTypeVariables++; return TypeVariable(index, std::move(_sort)); }