You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Another repro of LocallyAbortOperationThatFailsToResolveOverload #8520
This seems to be the smallest sample to get LocallyAbortOperationThatFailsToResolveOverload.
typeFoo=static memberBar(x:int)=()static memberBar(x:bool)=()static member inlineInvoke source =let inlinecall(_:^M,_:^N,a:^a)=((^Mor^N):(static memberBar:_->_)(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>.
error FS0043: A unique overload for method 'Bar' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member Foo.Bar : x:bool -> unit, static member Foo.Bar : x:int -> unit
So I believe this can be closed unless you expect something different 🙂
Activity
cartermp commentedon Feb 12, 2020
@NinoFloris this now emits an overload error
error FS0043: A unique overload for method 'Bar' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member Foo.Bar : x:bool -> unit, static member Foo.Bar : x:int -> unitSo I believe this can be closed unless you expect something different 🙂
NinoFloris commentedon Feb 12, 2020
Nice, closing.