aboutsummaryrefslogtreecommitdiffstats
path: root/src/c.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-15 16:15:23 +0000
committerDavid Robillard <d@drobilla.net>2009-10-15 16:15:23 +0000
commitd4b45062903586e86daed7d1f319df6b2133644b (patch)
treeef4e108822a2b2c22a3bfa7b606bbcb9baa57023 /src/c.cpp
parentd388d0a98042ede74a0240f3eebb9e6b2ef854b1 (diff)
downloadresp-d4b45062903586e86daed7d1f319df6b2133644b.tar.gz
resp-d4b45062903586e86daed7d1f319df6b2133644b.tar.bz2
resp-d4b45062903586e86daed7d1f319df6b2133644b.zip
Better error reporting for failed function compiles (print uncompilable type).
git-svn-id: http://svn.drobilla.net/resp/tuplr@224 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/c.cpp')
-rw-r--r--src/c.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/c.cpp b/src/c.cpp
index bf98638..1237979 100644
--- a/src/c.cpp
+++ b/src/c.cpp
@@ -95,7 +95,8 @@ struct CEngine : public Engine {
cprot.push_back(llType(at));
}
- THROW_IF(!llType(retT), Cursor(), "return has non-concrete type");
+ THROW_IF(!llType(retT), Cursor(),
+ (format("return has non-concrete type `%1%'") % retT->str()).str());
Function* f = new Function();
f->returnType = *llType(retT);
@@ -167,10 +168,11 @@ CEngine::compileLiteral(CEnv& cenv, AST* lit)
CFunc
CEngine::compileFunction(CEnv& cenv, AFn* fn, const AType& argsT)
{
- TEnv::GenericTypes::const_iterator gt = cenv.tenv.genericTypes.find(fn);
- assert(gt != cenv.tenv.genericTypes.end());
+ //TEnv::GenericTypes::const_iterator gt = cenv.tenv.genericTypes.find(fn);
+ //assert(gt != cenv.tenv.genericTypes.end());
CEngine* engine = reinterpret_cast<CEngine*>(cenv.engine());
- AType* genericType = new AType(*gt->second);
+ //AType* genericType = new AType(*gt->second);
+ AType* genericType = cenv.type(fn);
AType* thisType = genericType;
Subst argsSubst;