Errors, bugs, questions - page 2064

 
fxsaber:
Language bug

A bug in user code is not a bug: the InitIndicators(CIndicator *) method is missing

 
A100:

The error in the user code is not a bug: the InitIndicators(CIndicator *) method is missing

The letter s is missing, but the compiler message is erroneous, so the SD has taken to fixing it.

 
fxsaber:

The SDs have taken up the task of fixing it.

You can't fix something that doesn't contain an error. Look in the file <Indicator.mqh> - there will be class CIndicator without letter s
 
A100:
You cannot fix something that does not contain an error. Look in file <Indicator.mqh> - there will be class CIndicator without letter s

Write to the SR about it. They claim (not me) that there is an error and it will be corrected.

 
fxsaber:

Write to the SR about it. They claim (not me) that there is a bug and it will be fixed.

You originally stated the bug - can you explain what it is? What is wrong with it? Here is the simplified code:

class A1 {}; //Indicators
class A2 {}; //Indicator
class BB {
public:
    void f( A1 * ) {}
};
class B : public BB {
public:
    void f( A1 * ) {}
};
void OnStart()
{
    A2* a;
    B b;   
    b.f( a ); //error: 'f' - no one of the overloads can be applied to the function call
}
 
fxsaber:

Write to the SR about it. They claim (not me) that there is an error and it will be corrected.

The compiler's errormessage is not quite correct.

The compiler treats virtual method override as an overload, we will fix it.
 
Is this the correct compiler message?
int Tmp = 2;
  
if (Tmp % 2) // expression not boolean
 

Is it a bug?

// Добавление элемента в конец произвольного массива
template <typename T>
void AddArrayElement( T &Array[], T Value, const int Reserve = 0 )
{
  const int Size = ArraySize(Array);
  
  ArrayResize(Array, Size + 1, Reserve);
  
  Array[Size] = Value;
}

class A {};
class B : public A {};

void OnStart()
{
  A* Array[];
  
  A* a = new B; // no problem
  AddArrayElement(Array, (A*)(new B)); // no problem
  
  AddArrayElement(Array, new B); // template parameter ambiguous, could be 'A*' or 'B*'
}
 

How do I know the name of a file from its handle?

 
Limitation of language or syntax?
struct A
{
  int i;
};

struct B
{
  const A a;
  
  B() : a({0}) // 'a' - constructor not defined
  {
    const A b = {0}; // no problem
  }  
};
Reason: