diff options
| author | gingerBill <bill@gingerbill.org> | 2024-08-24 11:48:32 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-08-24 11:48:32 +0100 |
| commit | 00fb60d3d96877935012a4cc9cbd39525dc52d17 (patch) | |
| tree | 6f5cae9a60a9aa7a577656c589dede1564b1912e /src/check_expr.cpp | |
| parent | 68a83abcd62210fac764806445fd28296d722c26 (diff) | |
#4115 Add `Suggestion: 'typeid_of(T)'`
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 8e16bd0e9..a2500048e 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1180,11 +1180,15 @@ gb_internal void check_assignment(CheckerContext *c, Operand *operand, Type *typ LIT(article), LIT(context_name)); } else { + ERROR_BLOCK(); error(operand->expr, "Cannot assign '%s', a type, to %.*s%.*s", op_type_str, LIT(article), LIT(context_name)); + if (type && are_types_identical(type, t_any)) { + error_line("\tSuggestion: 'typeid_of(%s)'", expr_str); + } } break; default: |