7 #include <hilti/ast/type.h> 8 #include <hilti/ast/types/tuple.h> 9 #include <hilti/ast/types/unknown.h> 26 :
TypeBase(nodes(
type::Tuple({std::move(ktype), std::move(vtype)}, m)), m), _const(const_) {}
28 :
TypeBase(nodes(type::unknown, type::unknown), std::move(m)), _wildcard(
true), _const(const_) {}
30 const Type& keyType()
const {
31 if (
auto t =
children()[0].tryAs<type::Tuple>() )
32 return t->elements()[0].type();
34 return child<Type>(0);
37 const Type& valueType()
const {
38 if (
auto t =
children()[0].tryAs<type::Tuple>() )
39 return t->elements()[1].type();
41 return child<Type>(0);
48 auto isEqual(
const Type& other)
const {
return node::isEqual(
this, other); }
60 bool operator==(
const Iterator& other)
const {
61 return keyType() == other.keyType() && valueType() == other.valueType();
65 bool _wildcard =
false;
85 const Type& keyType()
const {
return child<map::Iterator>(0).keyType(); }
86 const Type& valueType()
const {
return child<map::Iterator>(0).valueType(); }
89 auto isEqual(
const Type& other)
const {
return node::isEqual(
this, other); }
92 return type::detail::isResolved(iteratorType(
true), rstate) &&
93 type::detail::isResolved(iteratorType(
false), rstate);
98 const Type&
iteratorType(
bool const_)
const {
return const_ ? child<Type>(0) : child<Type>(1); }
106 bool operator==(
const Map& other)
const {
return iteratorType(
true) == other.
iteratorType(
true); }
109 bool _wildcard =
false;
auto typeParameters() const
Definition: map.h:102
const Type & dereferencedType() const
Definition: map.h:52
auto typeParameters() const
Definition: map.h:56
const auto & children() const
Definition: node.h:470
const Type & elementType() const
Definition: map.h:96
auto isWildcard() const
Definition: map.h:100
bool isConstant() const
Definition: map.h:45
const Type & iteratorType(bool const_) const
Definition: map.h:98
auto isEqual(const Type &other) const
Definition: map.h:89
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
auto isWildcard() const
Definition: map.h:54
auto _isResolved(ResolvedState *rstate) const
Definition: map.h:50
auto properties() const
Definition: map.h:58
auto isEqual(const Type &other) const
Definition: map.h:48
auto _isResolved(ResolvedState *rstate) const
Definition: map.h:91
auto properties() const
Definition: map.h:104