Unqualified type names in compiler errors

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Unqualified type names in compiler errors

Post by Kromi »

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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unqualified type names in compiler errors

Post by robert »

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
robert@xsharp.eu
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Unqualified type names in compiler errors

Post by Kromi »

Sure, I have attached a solution with two identical projects, one for Vulcan.NET, one for X#.

Regards,
Mathias
Compatibility.zip
(775.16 KiB) Downloaded 81 times
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unqualified type names in compiler errors

Post by robert »

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
robert@xsharp.eu
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Unqualified type names in compiler errors

Post by Kromi »

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
Post Reply