@@ -1313,7 +1313,7 @@ static void ENTITYresolve_subtypes( Entity e ) {
13131313 * where "entity" represents a supertype (only, I believe)
13141314*/
13151315void ENTITYresolve_uniques ( Entity e ) {
1316- Variable attr ;
1316+ Variable attr , attr2 = 0 ;
13171317 int failed = 0 ;
13181318 LISTdo ( e -> u .entity -> unique , unique , Linked_List ) {
13191319 int i = 0 ;
@@ -1337,9 +1337,19 @@ void ENTITYresolve_uniques( Entity e ) {
13371337 ( expr -> e .op1 -> e .op_code == OP_GROUP ) &&
13381338 ( expr -> e .op1 -> e .op1 -> type == Type_Self ) ) {
13391339 attr = ENTITYresolve_attr_ref ( e , & ( expr -> e .op1 -> e .op2 -> symbol ), & ( expr -> e .op2 -> symbol ) );
1340+ attr2 = ENTITYresolve_attr_ref ( e , 0 , & ( expr -> e .op2 -> symbol ) );
13401341 } else {
13411342 attr = ENTITYresolve_attr_ref ( e , 0 , & ( expr -> symbol ) );
13421343 }
1344+ if ( ( attr2 ) && ( attr != attr2 ) && ( ENTITYdeclares_variable ( e , attr2 ) ) ) {
1345+ /* attr exists in type + supertype - it's a redeclaration.
1346+ * in this case, eliminate qualifiers */
1347+ reflink -> data = (Generic ) expr -> e .op2 ;
1348+ EXP_destroy ( expr -> e .op1 -> e .op1 );
1349+ EXP_destroy ( expr -> e .op1 -> e .op2 );
1350+ EXP_destroy ( expr -> e .op1 );
1351+ EXP_destroy ( expr );
1352+ }
13431353 if ( !attr ) {
13441354 /* ERRORreport_with_symbol(ERROR_unknown_attr_in_entity,*/
13451355 /* aref->attribute, aref->attribute->name,*/
0 commit comments