- Timestamp:
- Oct 4, 2019, 10:49:31 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- cf32116
- Parents:
- 4a60488
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
r4a60488 r90ce35aa 933 933 934 934 private: 935 template< typename RefType > 936 const RefType * handleRefType( const RefType * inst, const ast::Type * other ) { 935 // Returns: other, cast as XInstType 936 // Assigns this->result: whether types are compatible (up to generic parameters) 937 template< typename XInstType > 938 const XInstType * handleRefType( const XInstType * inst, const ast::Type * other ) { 937 939 // check that the other type is compatible and named the same 938 auto otherInst = dynamic_cast< const RefType * >( other );939 result = otherInst && inst->name == otherInst->name;940 auto otherInst = dynamic_cast< const XInstType * >( other ); 941 this->result = otherInst && inst->name == otherInst->name; 940 942 return otherInst; 941 943 } … … 958 960 } 959 961 960 template< typename RefType >961 void handleGenericRefType( const RefType * inst, const ast::Type * other ) {962 template< typename XInstType > 963 void handleGenericRefType( const XInstType * inst, const ast::Type * other ) { 962 964 // check that other type is compatible and named the same 963 const RefType * inst2= handleRefType( inst, other );964 if ( ! inst2) return;965 const XInstType * otherInst = handleRefType( inst, other ); 966 if ( ! this->result ) return; 965 967 966 968 // check that parameters of types unify, if any 967 969 const std::vector< ast::ptr< ast::Expr > > & params = inst->params; 968 const std::vector< ast::ptr< ast::Expr > > & params2 = inst2->params;970 const std::vector< ast::ptr< ast::Expr > > & params2 = otherInst->params; 969 971 970 972 auto it = params.begin();
Note: See TracChangeset
for help on using the changeset viewer.