!ASIS Issue #092 !topic Unwinding types for Corresponding_Expression_Type !reference ASIS 95-17.1 !from Sergey Rybin !keywords types subtypes unwinding Corresponding_Expression_Type !discussion 1. What does "unwinding subtypes" mean here? Suppose we have: type Int is range -10_000 .. 10_000 subtype Sub_Int is Int range -10 .. 10; Var : Sub_Int; What should be returned as Corresponding_Expression_Type for Sub_Int - the Element representing the declaration of type Int (but this would look like unwinding subtypes) or the declaration of subtype Sub_Int (this would look more logical and useful for applications, but this would contradict "Returns the type_declaration for the type of the ^^^^^^^^^^^^^^^^ expression" 2. What does unwinding derived types mean here? ^^^^^^^ If you unwind _derived_ types (opposite to unwinding subtypes), you change the type. !resolution Accept !date 98-03-26 !Notes To be more precise, replace the following in Clause 17.1 from: -- Returns the type_declaration for the type of the expression. This query -- does not "unwind" subtypes or derived types to get to the -- Corresponding_First_Subtype or Corresponding_Parent_Subtype declarations. to: -- Returns the type declaration for the type or subtype of the expression. -- This query does not "unwind" subtypes or derived types to get to the -- Corresponding_First_Subtype or Corresponding_Parent_Subtype declarations. -- For example, for the following program text: -- -- type Int is range -5_000 .. 5_000; -- type My_Int is new Int; -- type Good_Int is new My_Int; -- Var: Good_Int; -- -- The type declaration for Good_Int should be returned. The "unwinding" should -- not occur. The type declaration for either My_Int or Int should not be returned.