浏览代码

Fix Implicit Selector Expressions do not work at the global/package scope #484

gingerBill 5 年之前
父节点
当前提交
69afa33fa5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/check_decl.cpp

+ 1 - 1
src/check_decl.cpp

@@ -902,7 +902,7 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *e, Ast *type_expr,
 	}
 
 	Operand o = {};
-	check_expr(ctx, &o, init_expr);
+	check_expr_with_type_hint(ctx, &o, init_expr, e->type);
 	check_init_variable(ctx, e, &o, str_lit("variable declaration"));
 }