aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ll.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ll.cpp b/ll.cpp
index 1441171..368a3cd 100644
--- a/ll.cpp
+++ b/ll.cpp
@@ -663,12 +663,12 @@ compileFunction(CEnv& cenv, const std::string& name, ASTTuple& prot, const Type*
const TupV& texp = cenv.tenv.type(&prot)->tup;
vector<const Type*> cprot;
for (size_t i = 0; i < texp.size(); ++i) {
- const Type* t = cenv.tenv.type(texp[i])->ctype;
- if (!t) throw CompileError("Function parameter is untyped");
- cprot.push_back(t);
+ const AType* at = dynamic_cast<AType*>(texp[i]); assert(at);
+ if (!at->ctype) throw CompileError("Parameter is untyped");
+ cprot.push_back(at->ctype);
}
- if (!retT) throw CompileError("Function return is untyped");
+ if (!retT) throw CompileError("Return is untyped");
FunctionType* fT = FunctionType::get(retT, cprot, false);
Function* f = Function::Create(fT, linkage, name, cenv.module);