diff options
Diffstat (limited to 'll.cpp')
-rw-r--r-- | ll.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |