diff --git a/expr.cpp b/expr.cpp index 4ee0b52e..ac569693 100644 --- a/expr.cpp +++ b/expr.cpp @@ -211,6 +211,21 @@ lDoTypeConv(const Type *fromType, const Type *toType, Expr **expr, return false; } + if (dynamic_cast(fromType)) { + if (!failureOk) + Error(pos, "Can't convert function type \"%s\" to \"%s\" for %s.", + fromType->GetString().c_str(), + toType->GetString().c_str(), errorMsgBase); + return false; + } + if (dynamic_cast(toType)) { + if (!failureOk) + Error(pos, "Can't convert from type \"%s\" to function type \"%s\" " + "for %s.", fromType->GetString().c_str(), + toType->GetString().c_str(), errorMsgBase); + return false; + } + const ArrayType *toArrayType = dynamic_cast(toType); const ArrayType *fromArrayType = dynamic_cast(fromType); const VectorType *toVectorType = dynamic_cast(toType);