Explorar o código

don't try `iterator()` twice if resolved to dynamic access (#7363)

Aleksandr Kuzmenko %!s(int64=6) %!d(string=hai) anos
pai
achega
d44d032a74
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      src/typing/forLoop.ml

+ 5 - 2
src/typing/forLoop.ml

@@ -94,8 +94,11 @@ module IterationKind = struct
 				try_acc acc;
 			with Not_found ->
 				try_last_resort (fun () ->
-					let acc = type_field ({do_resume = resume;allow_resolve = false}) ctx e s e.epos MCall in
-					try_acc acc
+					match !dynamic_iterator with
+					| Some e -> e
+					| None ->
+						let acc = type_field ({do_resume = resume;allow_resolve = false}) ctx e s e.epos MCall in
+						try_acc acc
 				)
 		in
 		e1,pt