Skip to content

Commit

Permalink
[java/cs] Fix not finding the correct overload when using abstracts; …
Browse files Browse the repository at this point in the history
…Only select overload for constructors if it's actually needed
  • Loading branch information
waneck committed Jun 23, 2014
1 parent b77bcb8 commit ac2c096
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gencommon.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3987,6 +3987,8 @@ struct

(try
List.iter2 (fun a o ->
let o = run_follow gen o in
let a = run_follow gen a in
unify a o
(* type_eq EqStrict a o *)
) applied original
Expand Down Expand Up @@ -5959,6 +5961,7 @@ struct
match arglist, elist with
| [], [] -> true
| (_,_,t) :: arglist, et :: elist -> (try
let t = run_follow gen t in
unify et t;
check_arg arglist elist
with | Unify_error el ->
Expand All @@ -5972,7 +5975,11 @@ struct
let args, _ = get_fun t in
check_arg args etl
in
is_overload, List.find check_cf ctors, sup, ret_stl
match is_overload, ctors with
| false, [c] ->
false, c, sup, ret_stl
| _ ->
is_overload, List.find check_cf ctors, sup, ret_stl

(*
Expand Down

0 comments on commit ac2c096

Please sign in to comment.