Warning XS9073

This forum is meant for questions and discussions about the X# language and tools
Post Reply
leon-ts
Posts: 429
Joined: Fri Feb 03, 2017 1:43 pm

Warning XS9073

Post by leon-ts »

Hi,

In what case does the compiler generate warning XS9073 instead of error XS0103 if the variable is not declared?

XS9073: Variable 'SomeVariable' has not been declared. Assuming this is a FIELD or a MEMVAR.
XS0103: The name 'SomeVariable' does not exist in the current context.

In one of my applications, when I compile a line of code that uses a non-existent variable, I get a warning instead of an error. This confused me. I made a separate example with a similar situation and the compiler generated an error as I expected. In both cases, the "/memvar" option is enabled in the project.

Best regards,
Leonid
Best regards,
Leonid
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Warning XS9073

Post by robert »

Leonid,
I would expect that this is a warning only when the compiler option "Allow Undeclared variables" (/undeclared) is enabled. Otherwise this should generate an error.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 429
Joined: Fri Feb 03, 2017 1:43 pm

Warning XS9073

Post by leon-ts »

Robert,
Indeed! Many thanks!

Best regards,
Leonid
Best regards,
Leonid
Post Reply