diff options
| author | gingerBill <bill@gingerbill.org> | 2020-12-17 14:23:45 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-12-17 14:23:45 +0000 |
| commit | 720f2c7c61ddfc79deba2bb29b3727b50314cafb (patch) | |
| tree | 11d06b69bc38f4ee79e36e37d719f632a20be75d /src | |
| parent | e6dfc22b8a5309e9c387587108c73b4b49ac2ca4 (diff) | |
Allow `check_expr_with_type_hint` to allow assignment of types to typeid without requiring `typeid_of`
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_expr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b0012bfcc..63b275c99 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7910,7 +7910,9 @@ void check_expr_with_type_hint(CheckerContext *c, Operand *o, Ast *e, Type *t) { err_str = "used as a value"; break; case Addressing_Type: - err_str = "is not an expression but a type"; + if (t == nullptr || !is_type_typeid(t)) { + err_str = "is not an expression but a type"; + } break; case Addressing_Builtin: err_str = "must be called"; |