================================================================================
Array assignment with spaced enum value (known limitation)
================================================================================

codeunit 50100 "Test"
{
    procedure TestSpacedEnum()
    var
        SalesLineType: array[2] of Enum "Sales Line Type";
    begin
        // Space before :: is not recognized - known limitation
        SalesLineType[1] := SalesLineType[1] ::Resource;
        SalesLineType[2] := SalesLineType[2] ::"G/L Account";
    end;
}

--------------------------------------------------------------------------------

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    (integer)
    (quoted_identifier)
    (procedure
      (procedure_keyword)
      (identifier)
      (var_section
        (var_keyword)
        (variable_declaration
          (identifier)
          (type_specification
            (array_type
              (integer)
              (type_specification
                (object_reference_type
                  (enum_keyword)
                  (quoted_identifier)))))))
      (code_block
        (comment)
        (assignment_statement
          (subscript_expression
            (identifier)
            (integer))
          (qualified_enum_value
            (subscript_expression
              (identifier)
              (integer))
            (identifier)))
        (assignment_statement
          (subscript_expression
            (identifier)
            (integer))
          (qualified_enum_value
            (subscript_expression
              (identifier)
              (integer))
            (quoted_identifier)))))))

================================================================================
Correct enum assignment without spaces
================================================================================

codeunit 50101 "Test"
{
    procedure TestEnumWithoutSpace()
    var
        SalesLineType: array[2] of Enum "Sales Line Type";
    begin
        // Without spaces - this works correctly
        SalesLineType[1] := SalesLineType[1]::Resource;
        SalesLineType[2] := SalesLineType[2]::"G/L Account";
    end;
}

--------------------------------------------------------------------------------

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (procedure
      (procedure_keyword)
      name: (identifier)
      (var_section
        (var_keyword)
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (array_type
              sizes: (integer)
              element_type: (type_specification
                (object_reference_type
                  object_type: (enum_keyword)
                  reference: (quoted_identifier)))))))
      (code_block
        (comment)
        (assignment_statement
          left: (subscript_expression
            object: (identifier)
            index: (integer))
          right: (qualified_enum_value
            enum_type: (subscript_expression
              object: (identifier)
              index: (integer))
            value: (identifier)))
        (assignment_statement
          left: (subscript_expression
            object: (identifier)
            index: (integer))
          right: (qualified_enum_value
            enum_type: (subscript_expression
              object: (identifier)
              index: (integer))
            value: (quoted_identifier)))))))
