Changeset 51b8582 for src/SynTree/TypeSubstitution.cc
- Timestamp:
- Feb 16, 2022, 11:33:08 AM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 7d7ef6f
- Parents:
- 9490621
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/TypeSubstitution.cc
r9490621 r51b8582 146 146 } 147 147 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 148 156 Type * TypeSubstitution::Substituter::postmutate( TypeInstType *inst ) { 149 157 BoundVarsType::const_iterator bound = boundVars.find( inst->name ); … … 158 166 // TODO: investigate preventing type variables from being bound to themselves in the first place. 159 167 if ( TypeInstType * replacement = dynamic_cast< TypeInstType * >( i->second ) ) { 160 if ( inst->name == replacement->name) {168 if ( are_same( inst, replacement ) ) { 161 169 return inst; 162 170 }
Note: See TracChangeset
for help on using the changeset viewer.