noisepage
noisepage copied to clipboard
Optimizer does not insert casts for differently-typed operands.
Feature Request
Optimizer does not insert casts for differently-typed operands.
Summary
In working on #1377, we originally planned to remove all implicit casts.
However, this breaks a ton of queries, such as select 1+1.0;
. @pmenon points out that the casts should be part of the plan, which is probably somewhere in the optimizer that needs tweaking.
Right now, #1377 will address this by including a legacy implicit casting code path surrounded by braces. Once this is addressed, go to sema_checking.cpp
and erase the brace-enclosed blocks of code that all start with // TODO(WAN): Legacy implicit casting code since the optimizer does not give us the right plan.
Whoever fixes this, please uncomment the test in sema_expr_test.cpp
which tests that implicit casting has been removed. Search for #1385
in that file to find it.