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); }
19 
21  auto properties() const { return node::Properties{}; }
22 
27  static Unknown create(Meta m = Meta()) { return Unknown(std::move(m)); }
28 
29 private:
30  Unknown(Meta m = Meta()) : TypeBase(std::move(m)) {}
31 };
32 
34 static const Type unknown = Unknown::create(Location("<singleton>"));
35 
36 } // namespace type
37 
38 inline const Node& to_node(const type::Unknown& /* t */) {
39  static Node unknown = Type(type::unknown);
40  return unknown;
41 }
42 
43 } // namespace hilti
auto properties() const
Definition: unknown.h:21
Definition: meta.h:18
auto isEqual(const Type &other) const
Definition: unknown.h:18
static Unknown create(Meta m=Meta())
Definition: unknown.h:27
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
Definition: type.h:152
Definition: node.h:97
Definition: location.h:17
Definition: unknown.h:13