Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Warning XS9073 07 Oct 2021 13:58 #19861

  • leon-ts


  • Posts: 172
  • 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

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

    Warning XS9073 07 Oct 2021 15:48 #19865

    • robert
    • robert's Avatar


  • Posts: 2371
  • 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

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

    Warning XS9073 07 Oct 2021 16:02 #19866

    • leon-ts


  • Posts: 172
  • Robert,
    Indeed! Many thanks!

    Best regards,
    Leonid

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

    • Page:
    • 1