Errors, bugs, questions - page 1919

 

Can you tell me if mql5 can comment on the error output during compilation like in php ?

 
Anton Ohmat:

Can you tell me if mql5 can comment on the error output during compilation like in php ?

GetLastError()? If not, what format would you like to see?
 
Alexey Kozitsyn:
GetLastError()? If not, what format do you want to see?

well in php there is @variable = ....

and the error output is commented - convenient for simple errors at compile time (e.g. for type inconsistencies during conversion to string)

 
Anton Ohmat:

well, in php there is @variable = ....

and the error output is commented - convenient for simple compile-time errors (e.g. for type inconsistencies during conversion to string)

In mql you have to check the error code explicitly (at runtime), while at compile time a warning will pop up with a possible type conversion error.
 
Alexey Kozitsyn:
In mql you have to check the error code explicitly (at runtime), and at compile time a warning will pop up, if there is a possible error in type conversion.
So, I want to partially disable the error output at compile time.
 
Anton Ohmat:
This is how I want to partially disable selective, error output at compile time.
There is no need to disable anything. No errors will occur if the types are correctly mapped to each other.
 
Anton Ohmat:
So, I want to partially disable the error output at compile time.
To avoid seeing errors and warnings at compile time, you just need to fix them in the code. Don't fool yourself, you want to work with money.
 

Ambiguity

struct A {
        int f() { return B::i; } //error: 'i' - protected member access error
};
struct B : A {
protected: //(*) или например private:
        static int i;
};
int B::i;
At the same time, without protected: (*) - compiles without errors

Expected: same behaviour both with and without protected: (*) string

Optional: C++ does not compile both cases

 
A100:

Ambiguity

At the same time, without the protected: (*) string - it compiles without errors

Expected: Same behavior both with and without protected: (*) string

"Predecessor" does not need to see protected/private fields.

If you want B::f() to be defined in A::f(), you will have to invent something in this case.
 
A100:

Optional: C++ does not compile both cases

If you add

struct B;

at the beginning of the code, one of the two cases should compile. maybe the mql compiler is so smart that it adds the missing forward declaration itself?

Reason: