Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cpp

    r85855b0 rd3aa55e9  
    162162Cost conversionCost(
    163163        const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
    164         const ast::SymbolTable & symtab, const ast::TypeEnvironment & env
     164const ast::SymbolTable & symtab, const ast::TypeEnvironment & env
    165165) {
    166166        if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( dst ) ) {
     
    284284        if ( const ast::BasicType * dstAsBasic = dynamic_cast< const ast::BasicType * >( dst ) ) {
    285285                conversionCostFromBasicToBasic( basicType, dstAsBasic );
    286         }       else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
     286        } else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
    287287                if ( dstAsEnumInst->base && !dstAsEnumInst->base->isTyped ) {
    288288                        cost = Cost::unsafe;
     
    368368                return;
    369369        }
    370         static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
    371         cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
     370
    372371        if ( !inst->base->isTyped ) {
     372                static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
     373                cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
    373374                if ( cost < Cost::unsafe ) {
    374375                        cost.incSafe();
     
    376377                return;
    377378        }
    378         cost.incUnsafe();
     379        // cost.incUnsafe();
    379380}
    380381
Note: See TracChangeset for help on using the changeset viewer.