https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123306
--- Comment #10 from Liam Powell <liam at liampwll dot com> ---
Lifting the parent of the mutually tagged type out to a non-generic package
works as a workaround. I'm not sure if this can be done internally without a
whole new implementation. This however introduces another error that seems to
be unrelated:
pragma Ada_2022;
pragma Extensions_Allowed (All_Extensions);
package Controller is
type Mutably_Tagged_Base is tagged null record with Size'Class => 128;
generic
package Controller_Inner is
generic
package Config is
type Mutably_Tagged_Child is new Mutably_Tagged_Base with null record;
end Config;
package My_Config is new Config;
generic
type T is private;
X : T; -- remove for working workaround
package G is
end G;
package My_G is new G
(My_Config.Mutably_Tagged_Child'Class,
My_Config.Mutably_Tagged_Child'(null record) -- remove for working
workaround
);
end Controller_Inner;
end Controller;