From 720f2c7c61ddfc79deba2bb29b3727b50314cafb Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 17 Dec 2020 14:23:45 +0000 Subject: [PATCH] Allow `check_expr_with_type_hint` to allow assignment of types to typeid without requiring `typeid_of` --- src/check_expr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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";