Improved type conversion diagnostic messages.

Allowed incompatible pointer assignments with warnings.
Fixed Issue #1089.
This commit is contained in:
acqn
2020-08-02 21:51:32 +08:00
committed by Oliver Schmidt
parent d841bbe498
commit 003d47cc8b
4 changed files with 82 additions and 32 deletions

View File

@@ -78,7 +78,8 @@ static int CopyStruct (ExprDesc* LExpr, ExprDesc* RExpr)
/* Check for equality of the structs */
if (TypeCmp (ltype, RExpr->Type) < TC_STRICT_COMPATIBLE) {
Error ("Incompatible types");
TypeCompatibilityDiagnostic (ltype, RExpr->Type, 1,
"Incompatible types in assignment to '%s' from '%s'");
}
/* Do we copy using the primary? */