-
Notifications
You must be signed in to change notification settings - Fork 830
Description
Intrinsic extensions for static methods in interfaces fail to compile
Repro steps
[<Interface>]
type MyInterface<'T> =
interface end
type MyInterface with
static member ByPass (x: MyInterface<'t>) = x
Expected behavior
Compile
Actual behavior
Error: stdin(6,6): error FS0956: Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope.
Known workarounds
Removing lines 2 and 3, but obviously in real life code this means duplicating all the module let bindings code that might sit between those 2 lines and are needed to implement ByPass
and other static members defined in the interface.
Related information
Provide any related information (optional):
Microsoft (R) F# Interactive version 12.8.0.0 for F# 8.0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status