-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

the following example produces a stack overflow in omc 1.5.0.svn.r5700-1.deb

package Test
    class A
        extends B;
        Real x;
        class B
            extends A;
            Real y; // double definition?
            B.B b; // This would not be needed for stack overflow, but
should be correct too
        end B;
    end A;
end Test;

I am not quite sure, why the extension from inner classes is even
allowed (maybe for some fancy type constructs), but the specification is
quite clear on that point. This is a little bit complicated, but from my
POV it should work that way:

- - when B is looked up from "extends B" in A, the "partially flattened"
environment of A is used in B which yields scope(B) = { 'B' = Test.A.B,
'x' = Real, y = 'Real', b = 'Test.A.B' }

- - when B is looked up itself, the above scope is handed down, which
_might_ result in a "double definition" error for y but at least should
succeed in type creation.

Basically the problem arises with circular inheritance, which would in
general require a fixed point analysis. But since the specification
simply states that the type names in extends clauses are looked up
ignoring all other extends clauses, it should work.

best regards,

Christoph

- --

Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzjh5UACgkQhMBO4cVSGS+/PgCfXxfL5Im0XUHa83vdhPSmhsm7
r7MAn2l00xtlIODbot76hCs9/va7vmH9
=jNtX
-----END PGP SIGNATURE-----

Reply via email to