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
Signature generation roundtrip issue: SRTP multi-witness constraint on type member #19594
moduleLiblet inlineRequireM<^Witnesses,^Twhen(^Witnesses or ^T):(static member M :^T->string)>(x:^T):string =((^Witnessesor^T):(static memberM:^T-> string) x)typeC(p:int)=memberx.P= p
typeWitnesses()=static memberM(x:C):string = sprintf "M(C), x = %d" x.P
static memberM(x:int64):string = sprintf "M(int64), x = %d" x
typeStaticMethods=static member inlineM<^Twhen(Witnesses or ^T):(static member M:^T->string)>(x:^T):string =
RequireM< Witnesses,^T>(x)
Actual generated signature (partial):
val inlineRequireM:
x:^T -> string when(^Witnessesor^T):(static memberM:^T-> string)...typeStaticMethods=static memberinline M:x:^T ->stringwhen (Witnesses or ^T):(static member M:^T->string)
Note: RequireM uses ^Witnesses (hat). StaticMethods.M uses Witnesses (no hat). Should be ^Witnesses.
Error on roundtrip compile:
error FS0340: The signature and implementation are not compatible because the declaration of the type parameter requires a constraint of the form (^Witnesses or ^T) : (static member M: ^T -> string)
Expected signature:
[<Class>]typeStaticMethods=static member inlineM<^Twhen(Witnesses or ^T):(static member M:^T->string)>:x:^T ->string
Verified: roundtrips successfully with explicit type param syntax.
Activity
T-Gro commentedon Apr 17, 2026
Additional repro found by corpus sweep (also fixed by this change):
Before fix, generated sig had type application syntax that failed to parse (FS0010). The explicit type param declaration fix resolves this as well.
Fix #19594: SRTP constraints use explicit type param syntax in signat…
Fix #19594: SRTP constraints use explicit type param syntax in signat…
Fix #19594: SRTP constraints use explicit type param syntax in signat…
Fix #19594: SRTP constraints use explicit type param syntax in signat…