-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Milestone
Description
This seems to be the smallest sample to get LocallyAbortOperationThatFailsToResolveOverload.
type Foo =
static member Bar (x: int) = ()
static member Bar (x: bool) = ()
static member inline Invoke source =
let inline call (_: ^M, _: ^N, a: ^a) =
((^M or ^N): (static member Bar: _ -> _)(a))
call (Unchecked.defaultof<Foo>, Unchecked.defaultof<_>, source)
// or similarly but gives a different error location at null
call (Unchecked.defaultof<Foo>, null, source)
// no inference here so this returns a nice overload ambiguity error
call (Unchecked.defaultof<Foo>, Unchecked.defaultof<obj>, source) error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. internal error: Exception of type 'FSharp.Compiler.ConstraintSolver+LocallyAbortOperationThatFailsToResolveOverload' was thrown. Consider adding further type constraints
It was fairly educational to see handling of this differ between Unchecked.defaultof<_> null and Unchecked.defaultof<obj>.
I assume this is fixed in #8294
Metadata
Metadata
Assignees
Labels
No labels