From 8a1563a7c6d3507feb338fe86017e11bfbecee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Peter=20Rouven=20M=C3=BCller?= Date: Tue, 16 Oct 2018 22:24:04 +0200 Subject: [PATCH] Fix #5531 This is a working fix for the example of #5531. However there are still some points open before I think it's a good idea to merge this: - Discuss the change of this proposal, is it OK to prefer overrides of methods and so ignore base implementations? - Extend the check to the complete inheritance graph instead of a single "look-back" - Only ignore a methinfo if the signature of both match (so respect different overloads) @dsyme It would be great if you could have a look whether this check is allowed at this location or should appear earlier. --- src/fsharp/ConstraintSolver.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 8363ea03d6c..0b254156d04 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -1310,7 +1310,12 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p minfos // curried members may not be used to satisfy constraints |> List.choose (fun minfo -> - if minfo.IsCurried then None else + if minfo.IsCurried then None + elif (minfos |> List.exists(fun minfo1 -> + match minfo1.DeclaringTyconRef.TypeContents.tcaug_super with + | Some(TType_app(parent, _)) -> tyconRefEq g parent minfo.DeclaringTyconRef + | _ -> false)) then None + else let callerArgs = argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr)) let minst = FreshenMethInfo m minfo let objtys = minfo.GetObjArgTypes(amap, m, minst)