diff options
Diffstat (limited to 'Build/source/utils/asymptote/application.cc')
-rw-r--r-- | Build/source/utils/asymptote/application.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/application.cc b/Build/source/utils/asymptote/application.cc index 551ab70e80e..5a287bf2559 100644 --- a/Build/source/utils/asymptote/application.cc +++ b/Build/source/utils/asymptote/application.cc @@ -243,6 +243,10 @@ bool application::matchSignature(env &e, types::signature *source, arglist &al) { formal_vector &f=source->formals; +#if 0 + cout << "num args: " << f.size() << endl; +#endif + // First, match all of the named (non-rest) arguments. for (size_t i=0; i<f.size(); ++i) if (f[i].name) @@ -326,14 +330,27 @@ app_list multimatch(env &e, app_list l; +#if DEBUG_GETAPP + bool perfect=false; +#endif + for(ty_vector::iterator t=o->sub.begin(); t!=o->sub.end(); ++t) { if ((*t)->kind==ty_function) { +#if DEBUG_GETAPP + function *ft = dynamic_cast<function *>(*t); + if (equivalent(ft->getSignature(), source)) + perfect = true; +#endif application *a=application::match(e, (function *)(*t), source, al); if (a) l.push_back(a); } } +#if DEBUG_GETAPP + cout << (perfect ? "PERFECT" : "IMPERFECT") << endl; +#endif + if (l.size() > 1) { // Return the most specific candidates. maximizer m; |