Changeset 9a19608 for src/AST/TypeEnvironment.cpp
- Timestamp:
- Jun 4, 2019, 4:49:30 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 9519aba
- Parents:
- 1867c96 (diff), de8dfac2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/TypeEnvironment.cpp
r1867c96 r9a19608 235 235 } 236 236 237 /// true if a type is a function type 238 bool isFtype( const Type * type ) { 239 if ( dynamic_cast< const FunctionType * >( type ) ) { 240 return true; 241 } else if ( auto typeInst = dynamic_cast< const TypeInstType * >( type ) ) { 242 return typeInst->kind == TypeVar::Ftype; 243 } else return false; 244 } 245 237 246 namespace { 238 /// true if a type is a function type239 bool isFtype( const Type * type ) {240 if ( dynamic_cast< const FunctionType * >( type ) ) {241 return true;242 } else if ( auto typeInst = dynamic_cast< const TypeInstType * >( type ) ) {243 return typeInst->kind == TypeVar::Ftype;244 } else return false;245 }246 247 247 /// true if the given type can be bound to the given type variable 248 248 bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) { … … 285 285 ptr<Type> common; 286 286 ptr<Type> newType = it->bound; 287 newType.get_and_mutate()->qualifiers = typeInst->qualifiers;287 reset_qualifiers( newType, typeInst->qualifiers ); 288 288 if ( unifyInexact( 289 289 newType, target, *this, need, have, open, … … 291 291 if ( common ) { 292 292 it->bound = std::move(common); 293 clear_qualifiers( it->bound );293 reset_qualifiers( it->bound ); 294 294 } 295 295 } else return false; 296 296 } else { 297 297 it->bound = std::move(target); 298 clear_qualifiers( it->bound );298 reset_qualifiers( it->bound ); 299 299 it->allowWidening = widen.first && widen.second; 300 300 } … … 351 351 if ( common ) { 352 352 c1->bound = std::move(common); 353 clear_qualifiers( c1->bound );353 reset_qualifiers( c1->bound ); 354 354 } 355 355 c1->data.isComplete |= data.isComplete; … … 411 411 if ( common ) { 412 412 to.bound = std::move(common); 413 clear_qualifiers( to.bound );413 reset_qualifiers( to.bound ); 414 414 } 415 415 } else return false; // cannot unify
Note: See TracChangeset
for help on using the changeset viewer.