VHDL Issue Number: 0162 Classification: Language Definition Problem Language Version: VHDL-87 Summary: Qualified expression checks may be too restrictive. Related Issues: Superseded By IR 1034 (Andy Tsay) Relevant LRM Sections: 7.3.4. Key Words and Phrases: Qualified expressions, subtype checks Current Status: Submitted 1076-1993 Disposition: Superseded (ISAC Issues Outstanding) Disposition Rationale: N/A Superseded By: 1034 ----------------------- Date Submitted: 1991/03/14 Author of Submission: Paul Menchini Author's Affiliation: CAD Language Systems, Inc. Author's Post Address: P.O. Box 13036 Research Triangle Park, NC 27709-3036 Author's Phone Number: (919) 361-1913 Author's Fax Number: Author's Net Address: mench@clsi.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.10 $ Date Last Revised: $Date: 1995/08/04 01:43:10 $ Description of Problem ---------------------- Consider the opening sentence of Section 7.3.4 (on page 7-12): A qualified expression is used to explicitly state the type, and possibly the subtype, of an operand that is an expression or an aggregate. Also consider the final sentence of the same section: The evaluation of a qualified expression evaluates the operand and checks that its value belongs to the subtype denoted by the type mark. The first sentence quoted implies that subtype checks are not performed if the type mark denotes a type; however, the second sentence quoted seems to require subtype checks regardless. These checks are not problematic for scalar types, since every scalar type is, in effect, its own subtype. There may be problems with regard to array types, however. Consider the case of the type mark denoting a (constrained) array subtype. The subtype check seems to imply that the subtype of the expression or aggregate must *match* that of the array subtype; in other words, an implicit subtype conversion is not permitted. This seems overly restrictive. Finally consider the case of the type mark denoting an (unconstrained) array type. The second sentence still seems to require a subtype check, although there is no subtype to check. Note that Ada also suffers from these same problems. (To my knowledge, no Ada Issues have been recorded regarding qualified expressions.) It seems that the array case was overlooked. Proposed Resolution ------------------- Modify the final sentence of Section 7.3.4 to consider scalar and array types separately. The scalar case can be handled as is. The array case should consider array types and subtypes separately: array types should not require a subtype check, and array subtypes should permit an implicit subtype conversion to be performed. VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD