checker: deref fix

pull/4097/head
Joe Conigliaro 2020-03-22 01:27:10 +11:00
parent 9d80d261b9
commit fc43294efc
1 changed files with 4 additions and 0 deletions

View File

@ -724,6 +724,10 @@ pub fn (c mut Checker) expr(node ast.Expr) table.Type {
}
res := c.expr(it.right)
c.is_amp = false
// TODO: impl solid ref/deref strategy
if it.op == .mul && table.type_is_ptr(res) {
return table.type_deref(res)
}
return res
}
ast.None {