7 #include <hilti/ast/type.h> 8 #include <hilti/ast/types/tuple.h> 9 #include <hilti/ast/types/unknown.h> 25 :
TypeBase(nodes(
type::Tuple({std::move(ktype), std::move(vtype)}, m)), m), _const(const_) {}
27 :
TypeBase(nodes(type::unknown, type::unknown), std::move(m)), _wildcard(
true), _const(const_) {}
29 const Type& keyType()
const {
30 if (
auto t =
children()[0].tryAs<type::Tuple>() )
31 return t->elements()[0].type();
33 return child<Type>(0);
36 const Type& valueType()
const {
37 if (
auto t =
children()[0].tryAs<type::Tuple>() )
38 return t->elements()[1].type();
40 return child<Type>(0);
47 auto isEqual(
const Type& other)
const {
return node::isEqual(
this, other); }
59 bool operator==(
const Iterator& other)
const {
60 return keyType() == other.keyType() && valueType() == other.valueType();
64 bool _wildcard =
false;
84 const Type& keyType()
const {
return child<map::Iterator>(0).keyType(); }
85 const Type& valueType()
const {
return child<map::Iterator>(0).valueType(); }
88 auto isEqual(
const Type& other)
const {
return node::isEqual(
this, other); }
91 return type::detail::isResolved(iteratorType(
true), rstate) &&
92 type::detail::isResolved(iteratorType(
false), rstate);
97 const Type&
iteratorType(
bool const_)
const {
return const_ ? child<Type>(0) : child<Type>(1); }
105 bool operator==(
const Map& other)
const {
return iteratorType(
true) == other.
iteratorType(
true); }
108 bool _wildcard =
false;
auto typeParameters() const
Definition: map.h:101
const Type & dereferencedType() const
Definition: map.h:51
auto typeParameters() const
Definition: map.h:55
const auto & children() const
Definition: node.h:472
const Type & elementType() const
Definition: map.h:95
auto isWildcard() const
Definition: map.h:99
bool isConstant() const
Definition: map.h:44
const Type & iteratorType(bool const_) const
Definition: map.h:97
auto isEqual(const Type &other) const
Definition: map.h:88
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:98
auto isWildcard() const
Definition: map.h:53
auto _isResolved(ResolvedState *rstate) const
Definition: map.h:49
auto properties() const
Definition: map.h:57
auto isEqual(const Type &other) const
Definition: map.h:47
auto _isResolved(ResolvedState *rstate) const
Definition: map.h:90
auto properties() const
Definition: map.h:103