PR# 16974 Classes with generic constraints crash compiler in {AST_TYPE_A_GENERATOR}.process_formal_as
Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Medium
Date: 2010/07/20
Class: Bug
Severity: Serious
Number: 16974
Release: 6.7.83946
Confidential: No
Status: Closed
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.8) Gecko/20100226 Firefox/3.5.8
OpenSolaris snv_134 on x86
Synopsis: Classes with generic constraints crash compiler in {AST_TYPE_A_GENERATOR}.process_formal_as
Description
A set of classes which appear to be valid and that has a generic constraint that references a generic class with a generic constraint linked to another formal crashes the compiler in {AST_TYPE_A_GENERATOR}.process_formal_as. Added eweasel test term187 for this bug.
To Reproduce
Run eweasel test term187.
Problem Report Interactions
Fixed in rev#87352 of EiffelStudio 7.0 intermediate release.
I ran the associated test (term187) with a workbench compiler with assertions enabled (rev 84288). I got a compiler crash with: ------------------------------------------------------------------------------- FORMAL_GENERIC_LIST_AS i_th @2 valid_index: <0000000012ADCC40> (From ARRAYED_LIST) Precondition violated. Fail ------------------------------------------------------------------------------- The compiler is trying to look at the 2nd element of the list but there is only one element. It appears to be checking the generic constraint for class TEST1 which is G -> TEST2 [TEST3 [INTEGER], INTEGER] Note that TEST1 has only one formal generic, whereas TEST2 has 2 formals. I think the compiler is getting confused and looking at the wrong class or looking at the list of actual generics for the wrong class.