aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-10-15 17:54:37 +0100
committergingerBill <bill@gingerbill.org>2019-10-15 17:54:37 +0100
commit0bdc3b4f21eca0ff15d5053348711f4b60b7baab (patch)
tree7070c504e804b7f231ffdb7bad30734e6ef03438 /src
parenteaabb888d4e24ebcaccd1ae6c57f7dc8d762bd02 (diff)
Fix Values coerce to typeid #443
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 7c418c4f0..f8bb88595 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -676,17 +676,6 @@ void check_assignment(CheckerContext *c, Operand *operand, Type *type, String co
return;
}
- #if 0
- if (operand->mode == Addressing_Type) {
- Type *t = base_type(type);
- if (t->kind == Type_Pointer &&
- t->Pointer.elem == t_type_info) {
- add_type_info_type(c, type);
- return;
- }
- }
- #endif
-
if (is_type_untyped(operand->type)) {
Type *target_type = type;
if (type == nullptr || is_type_any(type)) {
@@ -1590,10 +1579,7 @@ void check_cast_error_suggestion(CheckerContext *c, Operand *o, Type *type) {
void check_is_expressible(CheckerContext *c, Operand *o, Type *type) {
GB_ASSERT(o->mode == Addressing_Constant);
- if (!is_type_constant_type(type)) {
- return;
- }
- if (!check_representable_as_constant(c, o->value, type, &o->value)) {
+ if (!is_type_constant_type(type) || !check_representable_as_constant(c, o->value, type, &o->value)) {
gbString a = expr_to_string(o->expr);
gbString b = type_to_string(type);
defer(