mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Platform fixes.
This commit is contained in:
parent
5f894722df
commit
59ef5919fb
@ -17,6 +17,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <set>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
@ -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)) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
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<std::tuple<PrimitiveType, char const*, uint64_t>>{
|
||||
for (auto [type, name, arity]: std::initializer_list<std::tuple<PrimitiveType, char const*, size_t>>{
|
||||
{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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user