You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@etch.apache.org by scott comer <sc...@cisco.com> on 2009/01/21 00:05:04 UTC

[discuss]: (ETCH-27) mixins cause trouble when two or more mixed in files define a type with the same name.

https://issues.apache.org/jira/browse/ETCH-27

i want to include this fix in release 1.0.2.

wei found this bug on friday. consider these etch files:

-------------
module foo
service Foo
{
    mixin Bar
    mixin Baz
}
-------------

-------------
module bar
service Bar
{
    struct Entry( int x )
    void barGet( Entry e )
}
-------------

-------------
module baz
service Baz
{
    struct Entry( int x )
    void bazGet( Entry e )
}
-------------

this should be good, because bazGet should refer to its own Entry and
barGet to its own, too. but the compiler started the name search for
Entry in barGet at the top of the module tree (Foo) instead of in Bar.
by starting at the top, it found two Entry definitions, bar.Entry and
baz.Entry. not being able to distinguish between them, it declares them
ambiguous and ultimately fails.

rather, when barGet is being compiled, the search for Entry should start
with Bar. in the name checking section of the compiler it already does
just that. this fix just fixes name resolution in Compiler.java to work
the same way.