mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Provide some hints for dispatches with lhs (first param) that is const
This commit is contained in:
parent
95c124ca35
commit
1c6b2725b3
@ -496,6 +496,11 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatch_error(bool is_const) throw()
|
||||||
|
: std::runtime_error(std::string("No matching function to dispatch to") + (is_const?", parameter is const":""))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~dispatch_error() throw() {}
|
virtual ~dispatch_error() throw() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -526,7 +531,7 @@ namespace chaiscript
|
|||||||
++begin;
|
++begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw dispatch_error();
|
throw dispatch_error(plist.empty()?false:plist[0].is_const());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -182,7 +182,7 @@ namespace chaiscript
|
|||||||
retval = ss.call_function(node->children[i+1]->text, plb);
|
retval = ss.call_function(node->children[i+1]->text, plb);
|
||||||
}
|
}
|
||||||
catch(const dispatch_error &){
|
catch(const dispatch_error &){
|
||||||
throw Eval_Error("Mismatched types in equation", node->children[i+1]);
|
throw Eval_Error(std::string("Mismatched types in equation") + (lhs.is_const()?", lhs is const.":"."), node->children[i+1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const dispatch_error &){
|
catch(const dispatch_error &){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user