VHDL Issue Number: 1034 Classification: Language Definition Problem Language Version: VHDL-93 Summary: Qualified expression checks may be too restrictive. Related Issues: Supersedes 0162 (Andy Tsay) Relevant LRM Sections: 7.3.4. Key Words and Phrases: Qualified expressions, subtype checks Current Status: Superseded by 1073 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1991/03/14 Author of Submission: Paul Menchini Author's Affiliation: Menchini & Associates Author's Post Address: 2 Davis Drive P.O. Box 13036 Research Triangle Park, NC 27709-3036 Author's Phone Number: 919.990.9506 Author's Fax Number: 919.990.9507 Author's Net Address: mench@mercury.interpath.net ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.5 $ Date Last Revised: $Date: 1995/06/14 22:26:08 $ 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-1993 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD