3 ms·
Yes; if one pattern matching case infers that some field of an object is a function, but that is mutated to int, another case cannot keep going with that assump
by kazinator 3y ago
Yes; if one pattern matching case infers that some field of an object is a function, but that is mutated to int, another case cannot keep going with that assumption and generate code where the int is treated a function.
That would almost seem like a downstream compiler problem. If the pattern matching expander emits straightforward code, similar to what you would write by hand, then it would have to be the compiler doing the wrong thing there, like doing type inference without noticing that some location whose type was inferred was replaced by a differently typed object.
If pattern matching itself generates type hints for the compiler, then the fault could lie there.