浏览代码

use expression pos if there is no case pos

Simon Krajewski 8 年之前
父节点
当前提交
b61655fe1e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/typing/matcher.ml

+ 1 - 0
src/typing/matcher.ml

@@ -1399,6 +1399,7 @@ module Match = struct
 			| _ -> None,with_type
 		in
 		let cases = List.map (fun (el,eg,eo,p) ->
+			let p = match eo with Some e when p = null_pos -> pos e | _ -> p in
 			let case,bindings,pat = Case.make ctx t el eg eo with_type p in
 			case,bindings,[pat]
 		) cases in