Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cc

    ref1da0e2 re874605  
    340340                } else if ( const EnumInstType * enumInst = dynamic_cast< const EnumInstType * >( dest ) ) {
    341341                        const EnumDecl * base_enum = enumInst->baseEnum;
    342                         if ( const Type * base = base_enum->base ) { // if the base enum has a base (if it is typed)
     342                        if ( const Type * base = base_enum->base ) {
    343343                                if ( const BasicType * enumBaseAstBasic = dynamic_cast< const BasicType *> (base) ) {
    344344                                        conversionCostFromBasicToBasic(basicType, enumBaseAstBasic);
     
    634634        } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
    635635                const ast::EnumDecl * enumDecl = enumInst->base.get();
    636                 if ( const ast::Type * enumType = enumDecl->base.get() ) {
     636                if ( enumDecl->isTyped && !enumDecl->base.get() ) {
     637                        cost = Cost::infinity;
     638                } else if ( const ast::Type * enumType = enumDecl->base.get() ) {
    637639                        if ( const ast::BasicType * enumTypeAsBasic = dynamic_cast<const ast::BasicType *>(enumType) ) {
    638640                                conversionCostFromBasicToBasic( basicType, enumTypeAsBasic );
     
    716718        const ast::EnumDecl * baseEnum = enumInstType->base;
    717719        if ( const ast::Type * baseType = baseEnum->base ) {
    718                 cost = costCalc( baseType, dst, srcIsLvalue, symtab, env );
     720                costCalc( baseType, dst, srcIsLvalue, symtab, env );
    719721        } else {
    720                 (void)enumInstType;
    721722                static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };
    722723                cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
Note: See TracChangeset for help on using the changeset viewer.