I'm Reporting MQL5/MT5 Bugs Here

 
I have created this thread to have a place to report MQL5/MT5 bugs with sample codes and pictures. I don't expect to get answers, just trying to help make this platform better.
 
Warning for overloaded methods


For the following code I'm getting this warning:


class A
{
public:
   void Add(){}
};


class B: public A
{ 
public:  
   void Add(int x)
   {
      Add(); 
   }
};

the B::Add(int x) function is an overloaded version of A::Add(). Logically I expect the compiler to consider it as the following code:

class B
{
public:
   void Add(){}
   void Add(int x)
   {
      Add(); 
   }
};


The problem is where you want to extend a generic class, a simple call to the Add function has to be written like:

AGenericClass<ulong, CHashMap<int, CObject*>*>::Add();

So I think hidden method calling is a good feature, but unfortunately it's going to be disabled in a future version.
 

It is not a bug. 

This was already posted somewhere but can not find the link.

Try:

 void Add(int x)
   {
      this.Add(); 
   }
 
Enrique Dangeroux:

It is not a bug. 

This was already posted somewhere but can not find the link.

Try:

Your code will generate the same warning. Right now MQL5 is working like java. Removing this deprecated behavior as said in the warning makes it work like C++.  

The only workaround is:

   void Add(int x)
   {
      A::Add(); 
   }
 
Ehsan Tarakemeh:

Your code will generate the same warning. Right now MQL5 is working like java. Removing this deprecated behavior as said in the warning makes it work like C++.  

The only workaround is:

Which is the intention of MQ developpers, there was all a discussion about it on Russian forum. There is no bug.
 

I understand that methods calls needs to be qualified but how to qualify the iCustom function? I get the same warning here: 


   m_zz_handle = iCustom(Symbol(),0,"MyZigZag.mq5",m_zz_depth,m_zz_deviation,m_zz_backstep);


-> ?::iCustom 

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...