add type to heap parsing, and use it to add a coercion on stores when needed