aboutsummaryrefslogtreecommitdiffstats
path: root/src/unify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unify.cpp')
-rw-r--r--src/unify.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/unify.cpp b/src/unify.cpp
index ae05b67..48818e9 100644
--- a/src/unify.cpp
+++ b/src/unify.cpp
@@ -70,9 +70,7 @@ substitute(const AType* tup, const AType* from, const AType* to)
TList ret;
FOREACHP(AType::const_iterator, i, tup) {
if (**i == *from) {
- AType* type = new AType(*to);
- type->loc = (*i)->loc;
- ret.push_back(type);
+ ret.push_back(new AType(*to, (*i)->loc));
} else if (*i != to) {
const AType* elem = (*i)->as_type();
if (elem->kind == AType::EXPR)