Skip to content
Snippets Groups Projects
Commit 8750b06e authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix handling same types in promoting visitor

parent 876d97e9
No related branches found
No related tags found
No related merge requests found
......@@ -154,16 +154,21 @@ public:
 
public:
ReturnType eval(bool firstAttempt, const ParametersType& first, const ParametersType& second) {
if(first.selfTypeId() == second.selfTypeId())
return ReturnType(callback((const RealParametersType&) first, (const RealParametersType&) second));
if(firstAttempt) {
alib::Object casted = alib::castApi::getCastPool(first.selfTypeId()).cast(second);
return ReturnType(callback((const RealParametersType&) first, (const RealParametersType&) casted.getData()));
} else {
alib::Object casted = alib::castApi::getCastPool(first.selfTypeId()).cast(first);
alib::Object casted = alib::castApi::getCastPool(second.selfTypeId()).cast(first);
return ReturnType(callback((const RealParametersType&) casted.getData(), (const RealParametersType&) second));
}
}
 
bool available(bool firstAttempt, long long first, long long second) {
if(first == second) return true;
if(firstAttempt)
return alib::castApi::castAvailable(first, second);
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment