Changeset ce8c12f for src/ResolvExpr


Ignore:
Timestamp:
May 15, 2017, 11:30:26 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
d36c117
Parents:
65aca88
Message:

initial work on references: reference types passed through the system, very simple examples work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r65aca88 rce8c12f  
    4242                virtual void visit(PointerType *pointerType);
    4343                virtual void visit(ArrayType *arrayType);
     44                virtual void visit(ReferenceType *refType);
    4445                virtual void visit(FunctionType *functionType);
    4546                virtual void visit(StructInstType *aggregateUseType);
     
    428429        }
    429430
     431        void Unify::visit(ReferenceType *refType) {
     432                if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {
     433                        result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
     434                        markAssertions( haveAssertions, needAssertions, refType );
     435                        markAssertions( haveAssertions, needAssertions, otherRef );
     436                } // if
     437        }
     438
    430439        void Unify::visit(ArrayType *arrayType) {
    431440                ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 );
     
    595604                        TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt);
    596605                        assertf(otherParam, "Aggregate parameters should be type expressions");
    597                        
     606
    598607                        Type* paramTy = param->get_type();
    599608                        Type* otherParamTy = otherParam->get_type();
Note: See TracChangeset for help on using the changeset viewer.