- File:
-
- 1 edited
-
src/ResolvExpr/ConversionCost.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cpp
r85855b0 rd3aa55e9 162 162 Cost conversionCost( 163 163 const ast::Type * src, const ast::Type * dst, bool srcIsLvalue, 164 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env164 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env 165 165 ) { 166 166 if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( dst ) ) { … … 284 284 if ( const ast::BasicType * dstAsBasic = dynamic_cast< const ast::BasicType * >( dst ) ) { 285 285 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 ) ) { 287 287 if ( dstAsEnumInst->base && !dstAsEnumInst->base->isTyped ) { 288 288 cost = Cost::unsafe; … … 368 368 return; 369 369 } 370 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) }; 371 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 370 372 371 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 ); 373 374 if ( cost < Cost::unsafe ) { 374 375 cost.incSafe(); … … 376 377 return; 377 378 } 378 cost.incUnsafe();379 // cost.incUnsafe(); 379 380 } 380 381
Note:
See TracChangeset
for help on using the changeset viewer.