- File:
-
- 1 edited
-
src/ResolvExpr/ConversionCost.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cpp
rd3aa55e9 r85855b0 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 370 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) }; 371 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 371 372 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 );374 373 if ( cost < Cost::unsafe ) { 375 374 cost.incSafe(); … … 377 376 return; 378 377 } 379 //cost.incUnsafe();378 cost.incUnsafe(); 380 379 } 381 380
Note:
See TracChangeset
for help on using the changeset viewer.