RecordFlux icon indicating copy to clipboard operation
RecordFlux copied to clipboard

Uncompilable code when naming type after package

Open senier opened this issue 3 years ago • 0 comments

When using a type which has the same name as the containing package as a session variable, the resulting code does not compile:

package Conflict is

   type Conflict is mod 2 ** 8;

   generic
   session Session with
      Initial => Start,
      Final   => Error
   is
      X : Conflict;
   begin
      state Start
      is
      begin
         X := 42;
      transition
         goto Error
      end Start;

      state Error is null state;
   end Session;
end Conflict;

Compile
   [Ada]          rflx-conflict-session.adb
rflx-conflict-session.ads:65:08: error: invalid prefix in selected component "Conflict"

senier avatar Jul 24 '21 15:07 senier