Fix abuse of operator-> overload
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
c847d27763
commit
16a6a54df1
2 changed files with 8 additions and 9 deletions
|
@ -61,18 +61,18 @@ expr metavar_env::get_subst(unsigned midx) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
expr metavar_env::get_type(unsigned midx, unification_problems & up) {
|
expr metavar_env::get_type(unsigned midx, unification_problems & up) {
|
||||||
auto p = m_env[midx];
|
data const & d = m_env[midx];
|
||||||
expr t = p->m_type;
|
expr t = d.m_type;
|
||||||
if (t) {
|
if (t) {
|
||||||
return t;
|
return t;
|
||||||
} else {
|
} else {
|
||||||
t = mk_metavar();
|
t = mk_metavar();
|
||||||
expr s = p->m_subst;
|
expr s = d.m_subst;
|
||||||
m_env[midx] = data(s, t, p->m_ctx);
|
m_env[midx] = data(s, t, d.m_ctx);
|
||||||
if (s)
|
if (s)
|
||||||
up.add_type_of_eq(p->m_ctx, s, t);
|
up.add_type_of_eq(d.m_ctx, s, t);
|
||||||
else
|
else
|
||||||
up.add_type_of_eq(p->m_ctx, ::lean::mk_metavar(midx), t);
|
up.add_type_of_eq(d.m_ctx, ::lean::mk_metavar(midx), t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,8 +84,8 @@ expr metavar_env::get_type(unsigned midx) const {
|
||||||
void metavar_env::assign(unsigned midx, expr const & v) {
|
void metavar_env::assign(unsigned midx, expr const & v) {
|
||||||
inc_timestamp();
|
inc_timestamp();
|
||||||
lean_assert(!is_assigned(midx));
|
lean_assert(!is_assigned(midx));
|
||||||
auto p = m_env[midx];
|
data const & d = m_env[midx];
|
||||||
m_env[midx] = data(v, p->m_type, p->m_ctx);
|
m_env[midx] = data(v, d.m_type, d.m_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
context const & metavar_env::get_context(unsigned midx) const {
|
context const & metavar_env::get_context(unsigned midx) const {
|
||||||
|
|
|
@ -351,7 +351,6 @@ public:
|
||||||
ref(pvector & v, unsigned i):m_vector(v), m_idx(i) {}
|
ref(pvector & v, unsigned i):m_vector(v), m_idx(i) {}
|
||||||
ref & operator=(T const & a) { m_vector.set(m_idx, a); return *this; }
|
ref & operator=(T const & a) { m_vector.set(m_idx, a); return *this; }
|
||||||
operator T const &() const { return m_vector.get(m_idx); }
|
operator T const &() const { return m_vector.get(m_idx); }
|
||||||
T const * operator->() const { return &(m_vector.get(m_idx)); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
T const & operator[](unsigned i) const { return get(i); }
|
T const & operator[](unsigned i) const { return get(i); }
|
||||||
|
|
Loading…
Reference in a new issue