`typ` field in Expr objects

question

#1

What is the purpose/use of the typ field of an Expr. I’m using it with JuliaParser to store locations of expressions as they’re parsed (not for evaluation) but was wondering what the side effects of doing so is>


#2

It’s used by type inference to record the computed type bounds on expressions. If you’re not going to pass an expression to type inference (e.g. via eval), then it should be safe to use it for something else.


#3

I’m almost sure eval and type inference ignores it as input. Do note that the field can be gone at anytime without warning.


#4

Thanks, that’s good to hear!