aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.hpp')
-rw-r--r--src/resp.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/resp.hpp b/src/resp.hpp
index 57880f5..ba0ae4b 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -528,7 +528,8 @@ struct Subst : public list<Constraint> {
List out;
for (ATuple::const_iterator i = in->as_tuple()->begin(); i != in->as_tuple()->end(); ++i)
out.push_back(apply((*i)));
- out.head->loc = in->loc;
+ if (out.head)
+ out.head->loc = in->loc;
return out.head;
} else {
const_iterator i = find(in);
@@ -656,6 +657,7 @@ struct Engine {
virtual void eraseFn(CEnv& cenv, CFunc f) = 0;
virtual CVal compileCall(CEnv& cenv, CFunc f, const ATuple* fT, CVals& args) = 0;
+ virtual CVal compileCast(CEnv& cenv, CVal v, const AST* t) = 0;
virtual CVal compileCons(CEnv& cenv, const ATuple* t, CVal rtti, CVals& f) = 0;
virtual CVal compileDot(CEnv& cenv, CVal tup, int32_t index) = 0;
virtual CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AST* t) = 0;
@@ -726,7 +728,6 @@ struct CEnv {
return rec ? *rec : ast;
}
void setType(const AST* ast, const AST* type) {
- //assert(!ast->to_symbol());
const AST* tvar = tenv.var();
tenv.vars.insert(make_pair(ast, tvar));
tsubst.add(tvar, type);