AdaCore / gnatstudio

GNAT Studio is a powerful and lightweight IDE for Ada and SPARK.
399 stars 52 forks source link

@: must appear in the right-hand side of an assignment statement #178

Open evanescente-ondine opened 1 month ago

evanescente-ondine commented 1 month ago

Hi, I have an issue with the target name shorthand @ The following

procedure Deal (From, To: in out Deck; N: Card_Number) is
begin
    From    := (@.Number + N, To.List (To.List'Last-N+1..To.List'Last) & @.List); --17
    To      := (@.Number - N, @.list(@.List'First..@.List'Last-N)); --18
end Deal;

causes the errors:

x86_64-linux-gnu-gcc-13 -c cardpackage.adb
cardpackage.adb:17:29: error: must appear in the right-hand side of an assignment statement
cardpackage.adb:18:37: error: must appear in the right-hand side of an assignment statement
gnatmake: "cardpackage.adb" compilation error

Complete code here. If I change '@' by the corresponding left-hand name, it works.