Closed leon-ts closed 3 years ago
/vo16 option disabled If I enable the /vo16 option then no error occurs.
Leonid,
We had to change this because sometimes people were accidentally calling methods in a parent constructor, when they forgot to include "new" arguments defined in the child level, leading to unwanted side effects. This is the change that was documented in the second bullet in the what's new: Fixed a problem with calling a parent constructor in a class hierarchy where a parent level was being skipped and the constructor for the grandparent was called instead. In this example calling the grandparent constructor has no side effects, but for example if you had fields in the CitBasePageDialogWindow class that are declared with an initializer:
CLASS CitBasePageDialogWindow INHERIT CitDialogWindow
PROTECT IShouldBeInitialized := 42 AS LONG
....
END CLASS
Then you would see that the field `IShouldBeInitialized` is not initialized with the previous build.
Robert
Robert,
I carefully read whatsnew before installing version 2.7. And when I found out that the code that compiled in 2.6 stopped compiling, I thought, then I remembered this point and thought that something was broken. But when you have now clarified in more detail the purpose of this fix, then I completely agree that the new behavior of the compiler is preferable.
Thanks!
Best regards, Leonid
An error occurs when compiling the following example:
Error: XS1501 No overload for method '.ctor' takes 1 arguments
This is an artificially created example to demonstrate the problem. The original code where I encountered a compilation error uses VOGUI:
XSharp 2.6, like VO, has no problem compiling code like this.