diff options
Diffstat (limited to 'src/c.cpp')
-rw-r--r-- | src/c.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -83,14 +83,13 @@ CEngine::llType(const AType* t) { if (t == NULL) { return NULL; - } else if (t->kind == AType::PRIM) { + } else if (t->kind == AType::NAME) { if (t->head()->str() == "Nothing") return new string("void"); if (t->head()->str() == "Bool") return new string("bool"); if (t->head()->str() == "Int") return new string("int"); if (t->head()->str() == "Float") return new string("float"); if (t->head()->str() == "String") return new string("char*"); if (t->head()->str() == "Quote") return new string("char*"); - throw Error(t->loc, string("Unknown primitive type `") + t->str() + "'"); } else if (t->kind == AType::EXPR && t->head()->str() == "Fn") { AType::const_iterator i = t->begin(); const ATuple* protT = (*++i)->to_tuple(); @@ -121,7 +120,8 @@ CEngine::llType(const AType* t) ret->append("}*"); return ret; } - return new Type("void*"); + throw Error(t->loc, string("Unknown compiled type `") + t->str() + "'"); + return NULL; } CVal |