Skip to content

Commit

Permalink
Minimal fix for openscad#3118
Browse files Browse the repository at this point in the history
  • Loading branch information
thehans committed Jan 4, 2020
1 parent 90969e4 commit 268c151
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,14 @@ FunctionCall::FunctionCall(Expression *expr, const AssignmentList &args, const L
*/
void FunctionCall::prepareTailCallContext(const std::shared_ptr<Context> context, std::shared_ptr<Context> tailCallContext, const AssignmentList &definition_arguments)
{
if (this->resolvedArguments.empty()) {
if (this->resolvedArguments.empty() && !this->arguments.empty()) {
// Figure out parameter names
ContextHandle<EvalContext> ec{Context::create<EvalContext>(context, this->arguments, this->loc)};
this->resolvedArguments = ec->resolveArguments(definition_arguments, {}, false);
}

// FIXME: evaluate defaultArguments in FunctionDefinition / UserFunction and pass to FunctionCall instead of definition_arguments ?
if (this->defaultArguments.empty() && !definition_arguments.empty()) {
// Assign default values for unspecified parameters
for (const auto &arg : definition_arguments) {
if (this->resolvedArguments.find(arg->name) == this->resolvedArguments.end()) {
Expand Down

0 comments on commit 268c151

Please sign in to comment.