2 ms·
What compiler does that? What you're describing sounds like a weirdly designed type system, not a compiler that implements it. That said, this is an example of
by duped 4y ago
What compiler does that? What you're describing sounds like a weirdly designed type system, not a compiler that implements it.
That said, this is an example of the compiler being wrong.
If a value is changed to a data representation with different comparison semantics, and later compared to a different value of a different representation, it means the original optimization (hand wave over the definition of that) was unsound in the first place. AOT compilers would classify this as a bug that needs to be fixed imminently, and JIT compilers that do this kind of thing use something called dynamic deoptimization to remove the change once its been invalidated.