qore
qore copied to clipboard
Const and member variables of a class with the same name - user should be warned about it
Const and member variables of a class with the same name - user should be warned about it. To keep the backward compatibility a warning is the best solution.
For example this could be confusing:
class A {
private {
string test = "asd";
}
}
class B inherits A {
private {
const test = "123";
}
constructor() {
printf("B.test: %y\n", test);
printf("B::test: %y\n", B::test);
}
}
B b();
prints:
B.test: "asd"
B::test: "123"