Possible bug in compiler

 
int TrailingStop[10];

int init()
  {
  Print("+++++ init done");
  string s =DoubleToStr(TrailingStop,0);
  return(0);
  }

int deinit() { return(0);   }
int start() {  return(0);  }

compiles well on compile time, but throws error on runtime:

EURUSD,H1: invalid double number as parameter 1 for 'DoubleToStr' function
EURUSD,H1: +++++ init done
EURUSD,H1: loaded successfully

Maybe its good to check such errors by compile time?

 

There is a LOT the compiler could check at compile time but doesnt! Not so much a bug as an ommision I guess.

Mq4 has function prototypes but doesnt seem to use them effectively for compile time checking (apart from # of arguments) but just tries to cast everything at runtime.

If I stick with Mq4 I'll be tempted to see if there was some way to write a lint program for more checking... in the mean time one just has to be careful!

 
fx1.net:

Maybe its good to check such errors by compile time?

May happen with the mql4/5 unified compiler.
Reason: