Spicy
unknown.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/ast/type.h>
8 
9 namespace hilti {
10 namespace type {
11 
14 public:
15  bool operator==(const Unknown& /* other */) const { return true; }
16 
18  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
20  auto _isResolved(ResolvedState* rstate) const { return true; } // sic!
21 
23  auto properties() const { return node::Properties{}; }
24 
29  static Unknown create(Meta m = Meta()) { return Unknown(std::move(m)); }
30 
31 private:
32  Unknown(Meta m = Meta()) : TypeBase(std::move(m)) {}
33 };
34 
36 static const Type unknown = Unknown::create(Location("<singleton>"));
37 
38 } // namespace type
39 
40 inline const Node& to_node(const type::Unknown& /* t */) {
41  static Node unknown = Type(type::unknown);
42  return unknown;
43 }
44 
45 } // namespace hilti
auto properties() const
Definition: unknown.h:23
auto _isResolved(ResolvedState *rstate) const
Definition: unknown.h:20
Definition: meta.h:19
Definition: type.h:160
auto isEqual(const Type &other) const
Definition: unknown.h:18
static Unknown create(Meta m=Meta())
Definition: unknown.h:29
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:98
Definition: type.h:206
Definition: node.h:112
Definition: type.h:33
Definition: location.h:18
Definition: unknown.h:13