瀏覽代碼

minor inline optimization

Nicolas Cannasse 18 年之前
父節點
當前提交
7e7117372b
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      typer.ml

+ 1 - 0
typer.ml

@@ -2154,6 +2154,7 @@ and type_inline ctx f ethis params tret p =
 	if 	Plugin.defined "js" && (init <> None || !has_vars) then
 		None
 	else match e.eexpr, init with
+	| TBlock [e] , None -> Some { e with etype = tret; }
 	| _ , None -> Some { e with etype = tret; }
 	| TBlock l, Some init -> Some (mk (TBlock (init :: l)) tret e.epos)
 	| _, Some init -> Some (mk (TBlock [init;e]) tret e.epos)