Bug with MQL libraries

 

Hello, 

I came across a bug regarding importing MQL libraries (build 5146) that seems to involve the MQL runtime. The problem is that when changing the return type of a imported function, and the changed type has the same size with the prior one, the program that imports the function will fail to load. First move was to delete (plus recompile of course) the EX5 library, but it did not help, ultimately we have to reload the terminal for the functionality to return to normal

Here is how to reproduce it: 

Library eg "libbug.ex5"

#property library 
         
long libfun(void) export 
{        
        Alert("hello");          
         
        return true;
}               

Expert 

#import "libbug.ex5"  
        long libfun(void);
#import          
    
int OnInit() 
{        
        libfun(); 
         
        return(INIT_SUCCEEDED); 
 }      

 

Them just change the return type from long to ulong (on both files), recompile library/expert, but the expert will fail to load - unless we reload the terminal


greets