소스 검색

fixed issue #739

Nicolas Cannasse 13 년 전
부모
커밋
c75f5d009c
1개의 변경된 파일10개의 추가작업 그리고 6개의 파일을 삭제
  1. 10 6
      typer.ml

+ 10 - 6
typer.ml

@@ -1201,12 +1201,16 @@ and type_expr_with_type ctx e t =
 		| Some t ->
 			match follow t with
 			| TInst ({ cl_path = [],"Array" },[tp]) ->
-				let el = List.map (fun e ->
-					let e = type_expr_with_type ctx e (Some tp) in
-					unify ctx e.etype tp e.epos;
-					e
-				) el in
-				mk (TArrayDecl el) t p
+				(match follow tp with
+				| TMono _ ->					
+					type_expr ctx e
+				| _ ->
+					let el = List.map (fun e ->
+						let e = type_expr_with_type ctx e (Some tp) in
+						unify ctx e.etype tp e.epos;
+						e
+					) el in
+					mk (TArrayDecl el) t p)
 			| _ ->
 				type_expr ctx e)
 	| _ ->