Changeset 90ce35aa for src


Ignore:
Timestamp:
Oct 4, 2019, 10:49:31 AM (5 years ago)
Author:
Michael Brooks <mlbrooks@…>
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
Message:

Fixing new-resolver bug where libcfa build erroneously complains about ambiguous ?{} lookup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r4a60488 r90ce35aa  
    933933
    934934        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 ) {
    937939                        // 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;
    940942                        return otherInst;
    941943                }
     
    958960                }
    959961
    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 ) {
    962964                        // 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;
    965967
    966968                        // check that parameters of types unify, if any
    967969                        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;
    969971
    970972                        auto it = params.begin();
Note: See TracChangeset for help on using the changeset viewer.