Changeset 8fc15cf for src/ResolvExpr/TypeEnvironment.cc
- Timestamp:
- Jul 23, 2019, 4:46:33 PM (6 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:
- 83b52f1
- Parents:
- d6b03b7 (diff), fd642d2 (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/ResolvExpr/TypeEnvironment.cc
rd6b03b7 r8fc15cf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:19:47 2015 11 // Last Modified By : A aron B. Moss12 // Last Modified On : Mon Jun 18 11:58:00 201813 // Update Count : 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 18 14:27:00 2019 13 // Update Count : 5 14 14 // 15 15 … … 315 315 } 316 316 317 bool isFtype( const Type * type ) {317 bool isFtype( const Type * type ) { 318 318 if ( dynamic_cast< const FunctionType * >( type ) ) { 319 319 return true; … … 324 324 } 325 325 326 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {326 bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) { 327 327 switch ( data.kind ) { 328 328 case TypeDecl::Dtype: … … 336 336 case TypeDecl::Ttype: 337 337 // ttype unifies with any tuple type 338 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );338 return dynamic_cast< const TupleType * >( type ) || Tuples::isTtype( type ); 339 339 default: 340 340 assertf(false, "Unhandled tyvar kind: %d", data.kind); … … 343 343 } 344 344 345 bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {345 bool TypeEnvironment::bindVar( const TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) { 346 346 347 347 // remove references from other, so that type variables can only bind to value types … … 361 361 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to 362 362 std::unique_ptr< Type > newType( curClass->type->clone() ); 363 newType-> get_qualifiers() = typeInst->get_qualifiers();363 newType->tq = typeInst->tq; 364 364 if ( unifyInexact( newType.get(), bindTo, *this, need, have, openVars, widen & WidenMode( curClass->allowWidening, true ), indexer, common ) ) { 365 365 if ( common ) { … … 386 386 } 387 387 388 bool TypeEnvironment::bindVarToVar( TypeInstType *var1, TypeInstType *var2,389 TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, 388 bool TypeEnvironment::bindVarToVar( const TypeInstType * var1, const TypeInstType * var2, 389 TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, 390 390 const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) { 391 391
Note: See TracChangeset
for help on using the changeset viewer.