Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cc

    rb0d9ff7 rfc134a48  
    338338                } else if ( const EnumInstType * enumInst = dynamic_cast< const EnumInstType * >( dest ) ) {
    339339                        const EnumDecl * base_enum = enumInst->baseEnum;
    340                         if ( const Type * base = base_enum->base ) {
     340                        if ( const Type * base = base_enum->base ) { // if the base enum has a base (if it is typed)
    341341                                if ( const BasicType * enumBaseAstBasic = dynamic_cast< const BasicType *> (base) ) {
    342342                                        conversionCostFromBasicToBasic(basicType, enumBaseAstBasic);
     
    632632        } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
    633633                const ast::EnumDecl * enumDecl = enumInst->base.get();
    634                 if ( enumDecl->isTyped && !enumDecl->base.get() ) {
    635                         cost = Cost::infinity;
    636                 } else if ( const ast::Type * enumType = enumDecl->base.get() ) {
     634                if ( const ast::Type * enumType = enumDecl->base.get() ) {
    637635                        if ( const ast::BasicType * enumTypeAsBasic = dynamic_cast<const ast::BasicType *>(enumType) ) {
    638636                                conversionCostFromBasicToBasic( basicType, enumTypeAsBasic );
     
    696694        const ast::EnumDecl * baseEnum = enumInstType->base;
    697695        if ( const ast::Type * baseType = baseEnum->base ) {
    698                 costCalc( baseType, dst, srcIsLvalue, symtab, env );
     696                cost = costCalc( baseType, dst, srcIsLvalue, symtab, env );
    699697        } else {
    700698                (void)enumInstType;
Note: See TracChangeset for help on using the changeset viewer.