소스 검색

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

Aleksandr Kuzmenko 6 년 전
부모
커밋
d44d032a74
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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