Ignore:
Timestamp:
Feb 17, 2022, 2:35:23 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
a556492
Parents:
51b8582
Message:

Revereted some changes and added a fix to get around the current issue (traits can't refer to traits with the same polymorphic arguments).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/TypeSubstitution.cc

    r51b8582 r7d7ef6f  
    146146}
    147147
    148 static bool are_same( TypeInstType * left, TypeInstType * right ) {
    149         if ( left->baseType && right->baseType ) {
    150                 return left->baseType == right->baseType;
    151         } else {
    152                 return left->name == right->name;
    153         }
    154 }
    155 
    156148Type * TypeSubstitution::Substituter::postmutate( TypeInstType *inst ) {
    157149        BoundVarsType::const_iterator bound = boundVars.find( inst->name );
     
    166158                // TODO: investigate preventing type variables from being bound to themselves in the first place.
    167159                if ( TypeInstType * replacement = dynamic_cast< TypeInstType * >( i->second ) ) {
    168                         if ( are_same( inst, replacement ) ) {
     160                        if ( inst->name == replacement->name ) {
    169161                                return inst;
    170162                        }
Note: See TracChangeset for help on using the changeset viewer.