aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c.cpp10
-rw-r--r--src/llvm.cpp4
2 files changed, 9 insertions, 5 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;
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 1477917..d022413 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -114,7 +114,9 @@ struct LLVMEngine : 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());
+
FunctionType* fT = FunctionType::get(llType(retT), cprot, false);
Function* f = Function::Create(fT, linkage, name, module);