Created
November 14, 2020 10:57
-
-
Save En3Tho/25ecaafbb6472591cdd9e9db240a9c6f to your computer and use it in GitHub Desktop.
This file contains 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 IOptionalParameter = | |
abstract member Do: count: int * [<Optional; DefaultParameterValue 10>] length : int -> unit | |
type OptionalParameter() = | |
member _.Do(count, [<Optional; DefaultParameterValue 10>]length) = printf "%i" (count + length) | |
interface IOptionalParameter with | |
member this.Do(count, length) = | |
this.Do(count, length) | |
let op1 = OptionalParameter().Do 12 | |
let op2 = OptionalParameter().Do(12, 25) | |
let op3 = (OptionalParameter() :> IOptionalParameter).Do 12 | |
let op4 = (OptionalParameter() :> IOptionalParameter).Do(12,25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment