Ignore:
Timestamp:
Jun 15, 2018, 5:09:29 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env
Children:
97397a26
Parents:
1d7b0a8
Message:

Start of new environment implementation; terribly broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cc

    r1d7b0a8 r982f95d  
    1818#include "ConversionCost.h"              // for ConversionCost
    1919#include "Cost.h"                        // for Cost, Cost::infinity
    20 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
     20#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, ClassRef
    2121#include "SymTab/Indexer.h"              // for Indexer
    2222#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
     
    4343        Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
    4444                if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
    45                         if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
    46                                 if ( eqvClass->type ) {
    47                                         return castCost( src, eqvClass->type, indexer, env );
     45                        if ( ClassRef eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
     46                                if ( Type* boundTy = eqvClass.get_bound().type ) {
     47                                        return castCost( src, boundTy, indexer, env );
    4848                                } else {
    4949                                        return Cost::infinity;
Note: See TracChangeset for help on using the changeset viewer.