Ver código fonte

fixed broken cast

Nicolas Cannasse 19 anos atrás
pai
commit
082b27ea0a
2 arquivos alterados com 7 adições e 2 exclusões
  1. 4 0
      doc/CHANGES.txt
  2. 3 2
      typer.ml

+ 4 - 0
doc/CHANGES.txt

@@ -1,3 +1,6 @@
+2006-??-??: 1.10
+	fix in haxe.remoting.SocketConnection.readAnswer
+
 2006-11-22: 1.09
 	added neko.vm.Module and neko.vm.Loader
 	haxelib : allowed spaces in "run" arguments
@@ -21,6 +24,7 @@
 	fixed stack overflow when typedef = Dynamic
 	fixed Reflect.createInstance on F9
 	Array : slice optional length, fixed neko slice & splice
+	+ fixed cast return type
 
 2006-10-29: 1.08
 	fixed bug in flash -debug

+ 3 - 2
typer.ml

@@ -1849,10 +1849,11 @@ and type_expr ctx ?(need_val=true) (e,p) =
 			| x :: path -> (EType (List.fold_left (fun acc x -> (EField (acc,x),p)) (EConst (Ident x),p) path,name),p)
 		in
 		let cond = (ECall ((EField ((EConst (Type "Std"),p),"is"),p),[etmp;make_type tname]),p) in
-		type_expr ctx (EBlock [
+		let e = type_expr ctx (EBlock [
 			(EVars [("tmp",None,Some e)],p);
 			(EIf (cond,etmp,Some (EThrow (EConst (String "Class cast error"),p),p)),p);
-		],p)
+		],p) in
+		{ e with etype = t }
 
 and type_function ctx t static constr f p =
 	let locals = save_locals ctx in