~sircmpwn/harec

996198143165772acf7c0002b6f7b613eac1e318 — Sebastian 3 months ago a275ac5
check: remove unnecessary type_deliases

Signed-off-by: Sebastian <sebastian@sebsite.pw>
1 files changed, 2 insertions(+), 4 deletions(-)

M src/check.c
M src/check.c => src/check.c +2 -4
@@ 2998,8 2998,7 @@ check_expr_switch(struct context *ctx,

	struct expression *value = xcalloc(1, sizeof(struct expression));
	check_expression(ctx, aexpr->_switch.value, value, NULL);
	const struct type *type = type_dealias(ctx, value->result);
	type = lower_const(ctx, type, NULL);
	const struct type *type = lower_const(ctx, value->result, NULL);
	expr->_switch.value = value;
	if (!type_is_integer(ctx, type)
			&& type_dealias(ctx, type)->storage != STORAGE_POINTER


@@ 3044,8 3043,7 @@ check_expr_switch(struct context *ctx,
				xcalloc(1, sizeof(struct expression));

			check_expression(ctx, aopt->value, value, type);
			if (!type_is_assignable(ctx, type_dealias(ctx, type),
					type_dealias(ctx, value->result))) {
			if (!type_is_assignable(ctx, type, value->result)) {
				error(ctx, aopt->value->loc, expr,
					"Invalid type for switch case");
				return;