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

TOPIC:

BEGIN/END SEQUENCE causes compiler error XS0136 18 Jun 2022 18:50 #22801

  • Alf
  • Alf's Avatar
  • Topic Author


  • Posts: 51
  • Hi to all,
    after moving to 2.12.2.0 I get this compiler error:
    error XS0136: A local or parameter named 'Xs$Obj' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
    The concerned code line contains: "BEGIN SEQUENCE". Sorry for my stupidity but I don't understand this error message. I guess there are some situations BEGIN/END SEQUENCE is not allowed? How can I solve this? By the way: Same code makes no trouble in earlier X#-Versions (and also not in VO)..
    Alf

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

    BEGIN/END SEQUENCE causes compiler error XS0136 18 Jun 2022 18:52 #22802

    • robert
    • robert's Avatar


  • Posts: 2874
  • Alf,
    The XS$Obj variable is generated by the compiler for RECOVER statements.
    DO you have a nested Begin sequence .. end ?
    As always: example code helps a lot.

    Robert
    XSharp Development Team
    The Netherlands

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

    BEGIN/END SEQUENCE causes compiler error XS0136 19 Jun 2022 09:35 #22803

    • Alf
    • Alf's Avatar
    • Topic Author


  • Posts: 51
  • Robert,
    your guess is correct: Error XS0136 occurs here:
    BEGIN SEQUENCE
        // Some simple code
    RECOVER
        BEGIN SEQUENCE ---> Error XS0136
        // some simple code
        END SEQUENCE
    END SEQUENCE
    Is this coding no longer allowed in 2.12.2.0?
    Alf

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

    BEGIN/END SEQUENCE causes compiler error XS0136 19 Jun 2022 17:39 #22805

    • robert
    • robert's Avatar


  • Posts: 2874
  • Alf,
    It should be allowed, but is a bit unexpected.
    The problem is that the compiler in the current build generates a temporary variable for both sequence blocks with the same name.
    I'll change the compiler to make sure that no duplicate names are generated for the next build.
    For now I would recommend to replace the inner begin sequence .. end sequence with a
    try 
    .. your statements
    catch 
       throw
    end try
    Robert
    XSharp Development Team
    The Netherlands

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

    BEGIN/END SEQUENCE causes compiler error XS0136 20 Jun 2022 10:00 #22808

    • Alf
    • Alf's Avatar
    • Topic Author


  • Posts: 51
  • Hi Robert,
    thanks for answer and advise.
    Alf

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

    BEGIN/END SEQUENCE causes compiler error XS0136 20 Jun 2022 10:03 #22809

    • robert
    • robert's Avatar


  • Posts: 2874
  • XSharp Development Team
    The Netherlands

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

    • Page:
    • 1