CVS difference for ai05s/ai05-0203-1.txt
--- ai05s/ai05-0203-1.txt 2010/04/02 22:42:48 1.3
+++ ai05s/ai05-0203-1.txt 2010/06/07 04:02:06 1.4
@@ -1,4 +1,4 @@
-!standard 3.9.3(8/3) 10-04-02 AI05-0203-1/02
+!standard 3.9.3(8/3) 10-06-06 AI05-0203-1/03
!class binding interpretation 10-02-13
!status Amendment 2012 10-04-02
!status ARG Approved 10-0-0 10-02-28
@@ -14,16 +14,16 @@
!question
-There does not seems to be a rule that makes this illegal, although surely
-it must be:
+There seems to be a loophole regarding abstract types and return statements.
+Suppose the type Abstract_Type is declared to be an abstract type and consider
function Func return Abstract_Type'Class is
begin
return X : Abstract_Type;
end Func;
-Nothing in 3.9.3(8) applies to this (since it's not an
-object_declaration).
+This clearly has to be illegal since we cannot return a value of an abstract type.
+However, nothing in 3.9.3(8) applies to this {since it's not an object_declaration).
!recommendation
@@ -37,11 +37,11 @@
!discussion
-In the example in the question, the function is legal because it
-is returning a class-wide type, which is never abstract (3.9.3(1.2/2)).
+In the example in the question, the function appears to be currently legal because
+it is returning a class-wide type, which is never abstract (3.9.3(1.2/2)).
Since any type that is covered by the class-wide type is allowed in
the extended_return_statement, we could use a specific abstract
-type as shown. So we need to explcitly disallow this case.
+type as shown. So we need to explicitly disallow this case.
!corrigendum 3.9.3(8/3)
Questions? Ask the ACAA Technical Agent