xsharp.eu • Unqualified type names in compiler errors
Page 1 of 1

Unqualified type names in compiler errors

Posted: Tue Aug 21, 2018 12:21 pm
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

Unqualified type names in compiler errors

Posted: Tue Aug 21, 2018 1:38 pm
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

Unqualified type names in compiler errors

Posted: Wed Aug 22, 2018 6:34 am
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 80 times

Unqualified type names in compiler errors

Posted: Wed Aug 22, 2018 8:20 am
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

Unqualified type names in compiler errors

Posted: Wed Aug 22, 2018 8:26 am
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