Ignore:
Timestamp:
May 30, 2019, 4:10:24 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
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:
8d70648
Parents:
eba615c
Message:

Stubs for new resolver, implementation of new indexer, type environment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    reba615c rd76c588  
    2828#include "Alternative.h"           // for AltList, Alternative
    2929#include "AlternativeFinder.h"
     30#include "AST/Expr.hpp"
     31#include "AST/Type.hpp"
    3032#include "Common/SemanticError.h"  // for SemanticError
    3133#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
     
    222224                        cost.incReference();
    223225                }
     226        }
     227
     228        const ast::Expr * referenceToRvalueConversion( const ast::Expr * expr, Cost & cost ) {
     229                if ( expr->result.as< ast::ReferenceType >() ) {
     230                        // cast away reference from expr
     231                        cost.incReference();
     232                        return new ast::CastExpr{ expr->location, expr, expr->result->stripReferences() };
     233                }
     234               
     235                return expr;
    224236        }
    225237
Note: See TracChangeset for help on using the changeset viewer.