소스 검색

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