From: Eric Bezault To: "'bugs@berkeley.eiffel.com'" Cc: "'manus@eiffel.com'" , RC_Tools Subject: RE: Compiler/3426 Date: Sun, 18 May 2003 18:29:09 -0700 I guess I got too much sun on my head this afternoon. The rule I was talking about is not VTCG-6 but VTCG-4. Furthermore it seems that this rule is actually enforced when the actual generic parameter is not deferred: ------------------------------ class AA creation make feature make is do create foo foo.f end foo: FOO [STRING] end ------------------------------ although the error message is quite confusing: ------------------------------ Error code: VTCG Error: actual generic parameter does not conform to constraint. What to do: make sure that actual parameter is a type conforming to the constraint (the type appearing after `->' for the corresponding formal). Class: AA In declaration: FOO [STRING] For type: FOO [STRING] Argument number: 1: Actual generic parameter: STRING Type to which it should conform: COMPARABLE ------------------------------ I can see the reason why VTCG-4 is not enforced when the actual generic parameter is deferred, but is a crash at runtime when trying to create an instance of a deferred class a better solution for a so-called strongly typed language? I don't know... -- Eric Bezault -----Original Message----- From: bugs@berkeley.eiffel.com [mailto:bugs@berkeley.eiffel.com] Sent: Monday, May 19, 2003 2:33 AM To: ebezault@axarosenberg.com Subject: Compiler/3426 Thank you very much for your problem report. It has the internal identification `Compiler/3426'. If you want to add more information to your report or reply to our answer, please reply to this message without modifying the subject header. The individual assigned to look at your report is: Compiler_team. >Category: Compiler >Responsible: Compiler_team >Synopsis: VTCG-6 not checked >Arrival-Date: Sun May 18 17:33:00 PDT 2003 >Severity: non-critical >Priority: low >Confidential: no >Environment: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 >Description: It seems to me that VTCG-6, described in ETL3 4.82-00-00 page 262 (chapter 12) is not enforced by ISE Eiffel. This rule says that the actual generic parameters should have as creation procedures the procedures listed in the Constraint_creators clause of the constraint associated with their corresponding formal parameters. So in the example below: ------------------------ class AA creation make feature make is do create foo foo.f end foo: FOO [COMPARABLE] end ------------------------ class FOO [G -> COMPARABLE create default_create end] feature f is local a: G do create a print (a.generating_type) end end ------------------------ the compiler should have complained because in class A `foo' is declared of type FOO[COMPARABLE], but `default_create' is not a creation procedure of the actual generic parameter COMPARABLE (indeed, this class is deferred). Instead of that, the program crashed at runtime when attempting to create an instance of the deferred class COMPARABLE. Note that I didn't check yet what effect fixing this bug would have on AXA's source code. I will implement the checking of VTCG-6 in my Gobo lint tool and run it on AXA's source code to see if any of our classes violates this rule. I'll let you know the result. Also, I noticed that ISE Eiffel reports a syntax error when compiling: class A [G -> B create end] end But, although not very useful, ETL3 seems to allow empty Constraint_creators clauses. Indeed, Feature_list used in ETL3 4.82-00-00 page 261 (chapter 12) is declared in page 136 (chapter 7) as a list of zero or more Feature_name. >How-To-Repeat: