diff options
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index 7a875f3..66c3abe 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -64,11 +64,12 @@ AFn::compile(CEnv& cenv) const throw() { const AType* type = cenv.type(this); CFunc f = cenv.findImpl(this, type); - if (!f) { - f = cenv.engine()->compileFunction(cenv, this, type); - cenv.vals.def(cenv.penv.sym(name), f); - cenv.addImpl(this, f); - } + if (f) + return f; + + f = cenv.engine()->compileFunction(cenv, this, type); + cenv.vals.def(cenv.penv.sym(name), f); + cenv.addImpl(this, f); return f; } |