Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This is a working fix for the example of dotnet#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.
  • Loading branch information
realvictorprm authored Oct 16, 2018
1 parent 39fd7b8 commit 8a1563a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fsharp/ConstraintSolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a1563a

Please sign in to comment.