Ignore:
Timestamp:
Mar 8, 2024, 12:22:59 AM (7 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
03606ce
Parents:
76fe046
Message:

Change the common type interpretation of EnumPos?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    r76fe046 r06601401  
    681681
    682682        void postvisit( const ast::EnumPosType * enumPos ) {
    683                 if ( dynamic_cast<const ast::EnumPosType *>(type2) ) {
     683                if ( auto type2AsPos = dynamic_cast<const ast::EnumPosType *>(type2) ) {
    684684                        // result = commonType( type2AsPos->instance, enumPos->instance, tenv, need, have, open, widen );
    685                         result = enumPos;
     685                        // result = enumPos;
     686                        if ( enumPos->instance->base->name == type2AsPos->instance->base->name ) {
     687                                result = type2;
     688                        }
    686689                } else if ( dynamic_cast<const ast::BasicType *>(type2) ) {
    687690                        result = type2;
Note: See TracChangeset for help on using the changeset viewer.