1-- { dg-do compile } 2with Ada.Tags.Generic_Dispatching_Constructor; use Ada.Tags; 3package body abstract1 is 4 5 function New_T (Stream : not null access Root_Stream_Type'Class) 6 return T'Class is 7 function Construct is 8 new Generic_Dispatching_Constructor (T, Root_Stream_Type'Class, Input); 9 E : constant String := String'Input (Stream); 10 I : constant Tag := Internal_Tag (E); 11 12 begin 13 return Construct (I, Stream); 14 end New_T; 15 16 function Input (Stream : not null access Root_Stream_Type'Class) 17 return IT is 18 begin 19 return O : IT do 20 Integer'Read (Stream, O.I); 21 end return; 22 end Input; 23 24 function Input (Stream : not null access Root_Stream_Type'Class) 25 return FT is 26 begin 27 return O : FT do 28 Float'Read (Stream, O.F); 29 end return; 30 end Input; 31end abstract1; 32