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
I'm trying to use special encoding that was recommended by @dsyme in fsharp/fslang-suggestions#567 (comment) together with generic types that have multiple restrictions and fail to do this
Change when 'T :> I1 to when 'T :> I1 and 'T :> I2
Expected behavior
It works, just one more generic restriction is added
Actual behavior
error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'I2' and 'I1'. Consider using type annotations to resolve the ambiguity
error FS0071: Type constraint mismatch when applying the default type 'I1' for a type inference variable. The type 'I1' is not compatible with the type 'I2' Consider adding further type constraints
Known workarounds
Not use this approach
Related information
Provide any related information (optional):
.NET 6.0.202
Fsharp 6.0.4
The text was updated successfully, but these errors were encountered:
I'm trying to use special encoding that was recommended by @dsyme in fsharp/fslang-suggestions#567 (comment) together with generic types that have multiple restrictions and fail to do this
Sharplab link
Provide the steps required to reproduce the problem:
Code that works fine:
Change
when 'T :> I1
towhen 'T :> I1 and 'T :> I2
Expected behavior
It works, just one more generic restriction is added
Actual behavior
Known workarounds
Not use this approach
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: