Created
November 15, 2018 08:12
-
-
Save ArtemyB/8ce1ced372eae6cc4f745490aa27cf88 to your computer and use it in GitHub Desktop.
Implementing interface with overloaded method in F#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type IAbcd<'A, 'B> = | |
abstract member TheMethod : 'A * int -> 'B | |
abstract member TheMethod : 'A * string -> 'B | |
type Abcd<'A>() = | |
member x.TheMethod(a: 'A, i: int) = | |
printfn "%i" i | |
member x.TheMethod(a: 'A, s: string) = | |
printfn "%s" s | |
interface IAbcd<'A, unit> with | |
member x.TheMethod(a: 'A, i: int) = x.TheMethod(a, i) | |
member x.TheMethod(a: 'A, s: string) = x.TheMethod(a, s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment