fbpx

Unqualified type names in compiler errors

More
5 months 11 hours ago - 5 months 10 hours ago #1 by Mathias Koch
Unqualified type names in compiler errors was created by Mathias Koch
Hi,

while checking out how the X# compiler deals with our old Vulcan.NET code, I get a lot of compiler errors like this:
Error XS1715 'GapBaseComboBox.Font': type must be 'Font' to match overridden member 'Control.Font'

Since 'Font' and 'Control' exist in many namespaces it would be helpful if the type names in such errors were fully qualified, like this:
Error XS1715 'GapBaseComboBox.Font': type must be 'System.Drawing.Font' to match overridden member 'System.Windows.Forms.Control.Font'

The Vulcan.NET compile doesn't give an error for the same code. Is there a compatibility switch to influence it?

Regards,
Mathias
Last edit: 5 months 10 hours ago by Mathias Koch.

Please Log in or Create an account to join the conversation.

More
5 months 10 hours ago #2 by Robert van der Hulst
Replied by Robert van der Hulst on topic Unqualified type names in compiler errors
We may be able to change the message. I'll have to see.
Do you have an example of code that produces this message ?

Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

More
4 months 4 weeks ago #3 by Mathias Koch
Replied by Mathias Koch on topic Unqualified type names in compiler errors
Sure, I have attached a solution with two identical projects, one for Vulcan.NET, one for X#.

Regards,
Mathias

File Attachment:

File Name: Compatibility.zip
File Size:775 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
4 months 4 weeks ago #4 by Robert van der Hulst
Replied by Robert van der Hulst on topic Unqualified type names in compiler errors
Mathias,
I looked at your example and I see what the problem is:
You have created an assign on the DerivedForm class that takes a parameter of type Vulcan.VO.Font. The assign in the parent class has a type of System.Drawing.Font.
Our compiler does not allow that, unless you prefix the assign with the NEW keyword.
Vulcan does not generate a warning but silently creates an assign with the NEW modifier. I think that is not correct. It should have warned, because the compiler can't be sure if this is what you wanted to do.

I agree that the error message should include the fully qualified type name to help locate the problem.
I have added this to the list of tickets. You will be notified when this has been solved.

Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

More
4 months 4 weeks ago #5 by Mathias Koch
Replied by Mathias Koch on topic Unqualified type names in compiler errors
Thank you Robert.

I absolutely agree that this is bad code, but I also want to understand what the reason for the different behavior is. Thank you for explaning it.

Mathias

Please Log in or Create an account to join the conversation.