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
There are some cases where an invalid value is returned from a trait call.
Repro steps
Step A
try in fsi
type A = A with
static member ($) (A, a: float ) = 0.0
static member ($) (A, a: decimal) = 0M
static member ($) (A, a: 't ) = 0
let inline call x = ($) A x
send it
Step B
Now try this call 42.
Expected behavior
val it : float = 0.0
Actual behavior
val it : obj = <null>
Known workarounds
I haven't found one so far.
Operating system: Windows
FSI: F# Interactive version 11.4.2.0 for F# 5.0
Editing Tools: Visual Studio 2019
I didn't try in older versions, but I'm under the impression that this is a regression.
type A = A with
static member ($) (A, a: float ) = 0.0
static member ($) (A, a: decimal) = 0M
static member ($) (A, a: 't ) = 0
let inline call x = ($) A x
call 42. + 1.1
Which results in
type A =
| A
with
static member ( $ ) : A:A * a:'t -> int + 2 overloads
end
val inline call :
x: ^a -> ^_arg3
when (A or ^a) : (static member ( $ ) : A * ^a -> ^_arg3)
val it : float = nan
The bot was wrong (the repro needed a multi-submit FSI session, it did not reproduce in any other constellation).
The solution is to treat interactive similar to how lib+app scenario works by having fresh solutions to type parameter constraints (lib+app scenario handles this via pickling that always refreshes).
Removing the AI-thinks-issue-fixed label. The previous Repo Assist comment was incorrect — the original repro (multi-submit FSI session) was not properly tested. As @auduchinok and @gusty confirmed, the issue still reproduces in F# 10/11. @T-Gro has identified the root cause and a fix is in progress (#19471).
Apologies for the false positive.
Tested on: d507366 (2026-04-01), F# Interactive 15.2.100.0 for F# 11.0, FSharp.Core 11.0.100.
Activity
gusty commentedon Nov 13, 2021
And here's a repro to send to FSI in one shot
Which results in
when the expeced result should be
1.1edgarfgp commentedon Sep 19, 2022
@gusty I have tried today with on a script and on fsi and seems to be fixed now :)

FYI @vzarytovskii
gusty commentedon Sep 19, 2022
Yes, it works for me as well.
I wonder what was the fixing PR.
9 remaining items
github-actions commentedon Mar 22, 2026
auduchinok commentedon Mar 23, 2026
The issue seems to be reproducing per comments above. Should we add regression tests for the cases reported there instead of closing the issue?
gusty commentedon Mar 23, 2026
I can confirm, it still repro in F# 10
@T-Gro please re-open
Add regression test for #12386: SRTP trait call correct overload reso…
Fix SRTP overload resolution across FSI submissions (#12386)
T-Gro commentedon Mar 26, 2026
The bot was wrong (the repro needed a multi-submit FSI session, it did not reproduce in any other constellation).
The solution is to treat interactive similar to how lib+app scenario works by having fresh solutions to type parameter constraints (lib+app scenario handles this via pickling that always refreshes).
Good news is that fix is on the way.
github-actions commentedon Apr 1, 2026
🤖 This is an automated response from Repo Assist.
Removing the
AI-thinks-issue-fixedlabel. The previous Repo Assist comment was incorrect — the original repro (multi-submit FSI session) was not properly tested. As@auduchinokand@gustyconfirmed, the issue still reproduces in F# 10/11.@T-Grohas identified the root cause and a fix is in progress (#19471).Apologies for the false positive.
Tested on:
d507366(2026-04-01), F# Interactive 15.2.100.0 for F# 11.0, FSharp.Core 11.0.100.Fix SRTP overload resolution across FSI submissions (#12386)
Add regression test for #12386: SRTP trait call correct overload reso…
Fix dotnet#12386, SRTP trait call correct overload resolution in mult…