Get rid of more constructors and make mangled names optional.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <optional>
|
||||
#include "graph.hpp"
|
||||
#include "type.hpp"
|
||||
|
||||
@@ -15,11 +16,11 @@ class type_env {
|
||||
struct variable_data {
|
||||
type_scheme_ptr type;
|
||||
visibility vis;
|
||||
std::string mangled_name;
|
||||
std::optional<std::string> mangled_name;
|
||||
|
||||
variable_data()
|
||||
: variable_data(nullptr, visibility::local, "") {}
|
||||
variable_data(type_scheme_ptr t, visibility v, std::string n)
|
||||
: variable_data(nullptr, visibility::local, std::nullopt) {}
|
||||
variable_data(type_scheme_ptr t, visibility v, std::optional<std::string> n)
|
||||
: type(std::move(t)), vis(v), mangled_name(std::move(n)) {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user