瀏覽代碼

don't consider non-user-variables when checking effects (closes #5581)

Simon Krajewski 9 年之前
父節點
當前提交
58f4c414c8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/display/display.ml

+ 2 - 0
src/display/display.ml

@@ -410,6 +410,8 @@ module Diagnostics = struct
 			| TMeta((Meta.Extern,_,_),_) ->
 			| TMeta((Meta.Extern,_,_),_) ->
 				(* This is so something like `[inlineFunc()]` is not reported. *)
 				(* This is so something like `[inlineFunc()]` is not reported. *)
 				had_effect := true;
 				had_effect := true;
+			| TLocal v when not (Meta.has Meta.UserVariable v.v_meta) ->
+				()
 			| TConst _ | TLocal _ | TTypeExpr _ | TFunction _ when not in_value ->
 			| TConst _ | TLocal _ | TTypeExpr _ | TFunction _ when not in_value ->
 				no_effect e.epos;
 				no_effect e.epos;
 			| TConst _ | TLocal _ | TTypeExpr _ | TEnumParameter _ | TVar _ ->
 			| TConst _ | TLocal _ | TTypeExpr _ | TEnumParameter _ | TVar _ ->