dotnet/fsharp#14284
FundOurselves
Watch this session
Problem
- The error range is too wide, it includes the whole
T.Instance.Method("")
expression. - The error message is not very helpful, it doesn’t tell us which overload is being called.
- This behaviour is especially bad on bigger expressions, lambda arguments, and so on, as the error hides every other error and warning inside the expression.
type T() =
static member Instance = T()
member _.Method(_: double) = ()
member _.Method(_: int) = ()
T.Instance.Method("")
^^^^^^^^^^^^^^^^^^^^^
Error :
No overloads match for method 'Method'.
Known type of argument: string Available overloads:
- member T.Method: double -> unit // Argument at index 1 doesn't match
- member T.Method: int -> unit // Argument at index 1 doesn't match
Expected behavior
- The error range should be limited to the
Method
call. - The error message should be more specific, something like:
No matching overload for 'Method' with argument type 'string'
Champion
Links
- Date: 03-03-2023, 15:30 (GMT+1:00) Madrid
- Session link: https://us06web.zoom.us/j/82152246076?pwd=T0pQS1VzR09wa0xZU1Z5ZW9hMXY3UT09
- Passcode: 829397