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

don't ignore optional fields (respect haxe subtyping wrt overrides)

Nicolas Cannasse 9 жил өмнө
parent
commit
b9d8372757

+ 0 - 5
src/generators/genhl.ml

@@ -742,11 +742,6 @@ let rec to_type ?tref ctx t =
 			ctx.anons_cache <- (a,t) :: ctx.anons_cache;
 			ctx.anons_cache <- (a,t) :: ctx.anons_cache;
 			let fields = PMap.fold (fun cf acc ->
 			let fields = PMap.fold (fun cf acc ->
 				match cf.cf_kind with
 				match cf.cf_kind with
-				| Var _ when has_meta Meta.Optional cf.cf_meta ->
-					(*
-						if it's optional it might not be present, handle the field access as fully Dynamic
-					*)
-					acc
 				| Var _ when (match follow cf.cf_type with TAnon _ | TFun _ -> true | _ -> false) ->
 				| Var _ when (match follow cf.cf_type with TAnon _ | TFun _ -> true | _ -> false) ->
 					(*
 					(*
 						if it's another virtual or a method, it might not match our own (might be larger, or class)
 						if it's another virtual or a method, it might not match our own (might be larger, or class)