X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/c2ba7425955ae538e220cec79d9124756d1b4c8b..b9322dfb8efe37f6f88a899269bdf21015f4db9a:/src/typeInfo.h diff --git a/src/typeInfo.h b/src/typeInfo.h index 0fd4114..cbe421c 100644 --- a/src/typeInfo.h +++ b/src/typeInfo.h @@ -15,7 +15,8 @@ TypeInfo typeType(const Program & p, Type t) TypeInfo result; result.isStruct = true; if (t.name == "int" || t.name == "float" || t.name == "double" || - t.name == "char" || t.name == "long" || t.name == "short" || t.name == "bool") + t.name == "char" || t.name == "long" || t.name == "short" || t.name == "bool" || + t.name == "void") { result.isStruct = false; } @@ -47,7 +48,7 @@ TypeInfo typeExpr(const Program & p, const std::vector & globalName auto m = findStructMethod(p, e._method.methodName, tiCaller); if (!m.has_value()) throw "Unknown method"; - result = typeType(p, m.value().returnType); + result = typeType(p, m.value().t.returnType); break; } case ExprType::Lit: @@ -69,7 +70,7 @@ TypeInfo typeExpr(const Program & p, const std::vector & globalName typeExpr(p, globalNamespace, globalCtx, *e._dot.expr), e._dot.identifier); if (!sm.has_value()) throw "Unknown struct member"; - result = typeType(p, sm.value().type); + result = typeType(p, sm.value().t.type); break; } case ExprType::PrefixOp: