Add missing arity checks to compiler series
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
c9a7fbf6dd
commit
c1f0104edb
|
@ -58,7 +58,7 @@ void definition_defn::generate_llvm(llvm_context& ctx) {
|
|||
|
||||
void definition_data::insert_types(type_env_ptr& env) {
|
||||
this->env = env;
|
||||
env->bind_type(name, type_ptr(new type_data(name)));
|
||||
env->bind_type(name, type_ptr(new type_data(name, vars.size())));
|
||||
}
|
||||
|
||||
void definition_data::insert_constructors() const {
|
||||
|
|
|
@ -9,6 +9,7 @@ type_ptr parsed_type_app::to_type(
|
|||
if(parent_type == nullptr) throw 0;
|
||||
type_base* base_type;
|
||||
if(!(base_type = dynamic_cast<type_base*>(parent_type.get()))) throw 0;
|
||||
if(base_type->arity != arguments.size()) throw 0;
|
||||
|
||||
type_app* new_app = new type_app(std::move(parent_type));
|
||||
type_ptr to_return(new_app);
|
||||
|
|
|
@ -53,8 +53,8 @@ struct type_data : public type_base {
|
|||
|
||||
std::map<std::string, constructor> constructors;
|
||||
|
||||
type_data(std::string n)
|
||||
: type_base(std::move(n)) {}
|
||||
type_data(std::string n, int32_t a = 0)
|
||||
: type_base(std::move(n), a) {}
|
||||
};
|
||||
|
||||
struct type_arr : public type {
|
||||
|
|
Loading…
Reference in New Issue
Block a user