Issue error on attempted type convert from/to function type.

This commit is contained in:
Matt Pharr
2012-02-06 15:17:25 -08:00
parent 8e2b0632e8
commit 098ceb5567

View File

@@ -211,6 +211,21 @@ lDoTypeConv(const Type *fromType, const Type *toType, Expr **expr,
return false;
}
if (dynamic_cast<const FunctionType *>(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<const FunctionType *>(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<const ArrayType *>(toType);
const ArrayType *fromArrayType = dynamic_cast<const ArrayType *>(fromType);
const VectorType *toVectorType = dynamic_cast<const VectorType *>(toType);