Explorar o código

use correct error position for unifying while condition (closes #4370)

Dan Korostelev %!s(int64=10) %!d(string=hai) anos
pai
achega
2c07c48f00
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -3215,7 +3215,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 		let e = type_expr ctx e NoValue in
 		let e = type_expr ctx e NoValue in
 		ctx.in_loop <- old_loop;
 		ctx.in_loop <- old_loop;
 		let cond = type_expr ctx cond Value in
 		let cond = type_expr ctx cond Value in
-		let cond = Codegen.AbstractCast.cast_or_unify ctx ctx.t.tbool cond p in
+		let cond = Codegen.AbstractCast.cast_or_unify ctx ctx.t.tbool cond cond.epos in
 		mk (TWhile (cond,e,DoWhile)) ctx.t.tvoid p
 		mk (TWhile (cond,e,DoWhile)) ctx.t.tvoid p
 	| ESwitch (e1,cases,def) ->
 	| ESwitch (e1,cases,def) ->
 		begin try
 		begin try