2
0
Эх сурвалжийг харах

use expression pos if there is no case pos

Simon Krajewski 8 жил өмнө
parent
commit
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