Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cpp

    rd3aa55e9 r85855b0  
    162162Cost conversionCost(
    163163        const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
    164 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env
     164        const 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 
     370        static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
     371        cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
    371372        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 );
    374373                if ( cost < Cost::unsafe ) {
    375374                        cost.incSafe();
     
    377376                return;
    378377        }
    379         // cost.incUnsafe();
     378        cost.incUnsafe();
    380379}
    381380
Note: See TracChangeset for help on using the changeset viewer.