Changeset eb8d791 for src/ResolvExpr
- Timestamp:
- Apr 12, 2023, 3:10:28 PM (15 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 52f9804
- Parents:
- 153d3440
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r153d3440 reb8d791 279 279 /// Instantiates an argument to match a parameter, returns false if no matching results left 280 280 bool instantiateArgument( 281 const CodeLocation & location, 281 282 const ast::Type * paramType, const ast::Init * init, const ExplodedArgs_new & args, 282 283 std::vector< ArgPack > & results, std::size_t & genStart, const ast::SymbolTable & symtab, … … 289 290 // xxx - dropping initializer changes behaviour from previous, but seems correct 290 291 // ^^^ need to handle the case where a tuple has a default argument 291 if ( ! instantiateArgument( 292 if ( ! instantiateArgument( location, 292 293 type, nullptr, args, results, genStart, symtab, nTuples ) ) return false; 293 294 nTuples = 0; … … 341 342 // push empty tuple expression 342 343 newResult.parent = i; 343 newResult.expr = new ast::TupleExpr { CodeLocation{}, {} };344 newResult.expr = new ast::TupleExpr( location, {} ); 344 345 argType = newResult.expr->result; 345 346 } else { … … 614 615 /// Builds a list of candidates for a function, storing them in out 615 616 void makeFunctionCandidates( 617 const CodeLocation & location, 616 618 const CandidateRef & func, const ast::FunctionType * funcType, 617 619 const ExplodedArgs_new & args, CandidateList & out ); … … 732 734 /// Builds a list of candidates for a function, storing them in out 733 735 void Finder::makeFunctionCandidates( 736 const CodeLocation & location, 734 737 const CandidateRef & func, const ast::FunctionType * funcType, 735 738 const ExplodedArgs_new & args, CandidateList & out … … 768 771 for (size_t i=0; i<nParams; ++i) { 769 772 auto obj = funcDecl->params[i].strict_as<ast::ObjectDecl>(); 770 if (!instantiateArgument( 773 if (!instantiateArgument( location, 771 774 funcType->params[i], obj->init, args, results, genStart, symtab)) return; 772 775 } … … 778 781 // matches 779 782 // no default args for indirect calls 780 if ( ! instantiateArgument( 783 if ( ! instantiateArgument( location, 781 784 param, nullptr, args, results, genStart, symtab ) ) return; 782 785 } … … 1007 1010 newFunc->expr = 1008 1011 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); 1009 makeFunctionCandidates( newFunc, function, argExpansions, found ); 1012 makeFunctionCandidates( untypedExpr->location, 1013 newFunc, function, argExpansions, found ); 1010 1014 } 1011 1015 } else if ( … … 1017 1021 newFunc->expr = 1018 1022 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); 1019 makeFunctionCandidates( newFunc, function, argExpansions, found ); 1023 makeFunctionCandidates( untypedExpr->location, 1024 newFunc, function, argExpansions, found ); 1020 1025 } 1021 1026 } … … 1043 1048 newOp->expr = 1044 1049 referenceToRvalueConversion( newOp->expr, newOp->cost ); 1045 makeFunctionCandidates( newOp, function, argExpansions, found ); 1050 makeFunctionCandidates( untypedExpr->location, 1051 newOp, function, argExpansions, found ); 1046 1052 } 1047 1053 } -
src/ResolvExpr/ExplodedArg.hpp
r153d3440 reb8d791 35 35 ExplodedArg() : env(), cost( Cost::zero ), exprs() {} 36 36 ExplodedArg( const Candidate & arg, const ast::SymbolTable & symtab ); 37 37 38 38 ExplodedArg( ExplodedArg && ) = default; 39 39 ExplodedArg & operator= ( ExplodedArg && ) = default;
Note: See TracChangeset
for help on using the changeset viewer.