
26 Sep
2010
26 Sep
'10
1:12 p.m.
On 26/09/10 14:51, Mathias Gaunard wrote:
The idea, in order to provide better error messages, is to test whether all the expressions you're going to evaluate are going to lead to errors.
Then, if they don't, you evaluate said expressions. However, this basically ends up doing the same thing twice (or worse, checking the expressions are valid may be more costly than actually instanciating them) as far as the compiler is concerned.
Therefore I think the solution is to provide a compiler debug mode in which we do this testing, and one where we don't.
In my own epxerience, I have a global ENABLE_COMPILE_TIME_CHECK macro that control all instance of such tests.