blob: d3c663c89ebee6a2c052f366cefe4f64054ee4f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/**
** \file type/nil.cc
** \brief Implementation for type/nil.hh.
*/
#include <ostream>
#include <type/class.hh>
#include <type/nil.hh>
#include <type/record.hh>
#include <type/visitor.hh>
namespace type
{
/*------.
| Nil. |
`------*/
void Nil::accept(ConstVisitor& v) const { v(*this); }
void Nil::accept(Visitor& v) { v(*this); }
bool Nil::compatible_with(const Type& other) const
{
// FIXME DONE: Some code was deleted here
return dynamic_cast<const Record*>(&other.actual()) != nullptr
|| dynamic_cast<const Class*>(&other.actual()) != nullptr;
}
const Type* Nil::record_type_get() const { return record_type_; }
void Nil::record_type_set(const Type& type) const { record_type_ = &type; }
} // namespace type
|