- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
rb2ea0cd rc333ed2 26 26 #include "Candidate.hpp" 27 27 #include "CastCost.hpp" // for castCost 28 #include "CompilationState.h pp"28 #include "CompilationState.h" 29 29 #include "ConversionCost.h" // for conversionCast 30 30 #include "Cost.h" … … 2138 2138 } 2139 2139 2140 // get the valueE(...) ApplicationExpr that returns the enum value2141 const ast::Expr * getValueEnumCall(2142 const ast::Expr * expr,2143 const ResolvExpr::ResolveContext & context, const ast::TypeEnvironment & env ) {2144 auto callExpr = new ast::UntypedExpr(2145 expr->location, new ast::NameExpr( expr->location, "valueE"), {expr} );2146 CandidateFinder finder( context, env );2147 finder.find( callExpr );2148 CandidateList winners = findMinCost( finder.candidates );2149 if (winners.size() != 1) {2150 SemanticError( callExpr, "Ambiguous expression in valueE..." );2151 }2152 CandidateRef & choice = winners.front();2153 return choice->expr;2154 }2155 2156 2140 const ast::Expr * createCondExpr( const ast::Expr * expr ) { 2157 2141 assert( expr );
Note: See TracChangeset
for help on using the changeset viewer.