PR# 3475 VDRD-2: non conforming signature of selected feature
Problem Report Summary
Submitter: ericbe
Category: Compiler
Priority: Medium
Date: 2003/07/16
Class: Bug
Severity: Serious
Number: 3475
Release: 5.4.0403
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
Synopsis: VDRD-2: non conforming signature of selected feature
Description
The compiler does not check whether the version in the current class of a selected feature has a signature that conforms to the non-selected versions inherited from other parent branches. But this is a kind of redeclaration, so VDRD-2 should be checked. Otherwise we get a "dangerous" crash as in the example below because we have a call of the form x.y but there is no feature `y' available for the object attached to `x'. In some other cases it might not crash but call a wrong routine, who knows... So I think it would be safer if VDRD-2 was reported in that case, instead of playing Russian roulette. I don't know how feasible it would be to have that implemented in ISE Eiffel. It took me 30 minutes to have it in Gobo Lint. Here is what I got when running it on the code that we use at AXA: ---- [VDRD-2] class ROSE_HASH_TABLE (16,2): signature of selected feature `linear_representation' inherited from ROSE_LINEAR does not conform to the signature of replicated feature `linear_representation' in parent HASH_TABLE. ---- [VDRD-2] class GLOBAL_VANTAGE_EXTERNAL_INTEGER_TO_DATETIME_ITEM (11,5): signature of selected feature `convert_value' inherited from SUPPLIER_DATETIME_ITEM does not conform to the signature of replicated feature `convert_value' in parent SUPPLIER_EXTERNAL_INTEGER_ITEM. ---- [VDRD-2] class EV_ITEM_LIST_IMP (107,2): signature of selected feature `interface' does not conform to the signature of replicated feature `interface' in parent EV_PICK_AND_DROPABLE_ITEM_HOLDER_IMP. ---- [VDRD-2] class EV_TEXT_COMPONENT_I (17,2): signature of selected feature `interface' inherited from EV_TEXTABLE_I does not conform to the signature of replicated feature `interface' in parent EV_PRIMITIVE_I. ---- [VDRD-2] class EV_NOTEBOOK_IMP (610,2): signature of selected feature `interface' does not conform to the signature of replicated feature `interface' in parent EV_FONTABLE_IMP. ---- You'll noticed that it is a very small number considering that 9,400 classes were checked. So I don't think that we can say that having this error reported in ISE Eiffel is a real priority. And Gobo Lint can report it in the meantime anyway ;-) However it might be a good idea to fix the errors in the code. The firt two are occurrences in some AXA's classes. But the last three are in EiffelVision2 classes. Would it be possible to have these three classes fixed?
To Reproduce
Compile: ---------------- class TEST create make feature make is local b: B do create {C} b b.do_it end end ---------------- class A feature f: ANY is do create Result end end ---------------- class B inherit A redefine f end feature f: STRING is do Result := "gobo" end do_it is do print (f.item (1)) end end ---------------- class C inherit A select f end B rename f as fb end end ---------------- Run: ------------------------------------------------------------------------------- Class / Object Routine Nature of exception Effect ------------------------------------------------------------------------------- C do_it @1 Segmentation violation: <0000000000D20050> (From B) Operating system signal. Fail ------------------------------------------------------------------------------- C do_it @1 <0000000000D20050> (From B) Routine failure. Fail ------------------------------------------------------------------------------- TEST make @2 <0000000000D20048> Routine failure. Fail ------------------------------------------------------------------------------- TEST root's creation <0000000000D20048> Routine failure. Exit -------------------------------------------------------------------------------
Problem Report Interactions
State-Changed-From-To: open-analyzed State-Changed-By: Julian State-Changed-When: Wed Jul 16 15:50:34 PDT 2003 State-Changed-Why: Dear Eric, The VDRD-2 errors you reported in EiffelVision2 have now been fixed and will be available with the next release.