소스 검색

allow same-class and same-enum unification (fixed issue #966)

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

+ 2 - 1
type.ml

@@ -932,7 +932,8 @@ let rec unify a b =
 				a1.a_status := Closed
 			| _ -> ());
 			(match !(a2.a_status) with
-			| Statics _ | EnumStatics _ -> error []
+			| Statics c -> (match !(a1.a_status) with Statics c2 when c == c2 -> () | _ -> error [])
+			| EnumStatics e -> (match !(a1.a_status) with EnumStatics e2 when e == e2 -> () | _ -> error [])
 			| Opened -> a2.a_status := Closed
 			| _ -> ())
 		with