F#'s Indexer setters don't work with optional parameters, but C#'s do.
Related #9369
Repro steps
open System.Runtime.CompilerServices
type A() =
member this.Item
with get (key: string, [<CallerFilePath>]?path: string, [<CallerLineNumber>]?line: int) =
printfn "%A" (key, path, line)
"_"
// error FS1212: Optional arguments must come at the end of the argument list, after any non-optional arguments
and set (key: string, [<CallerFilePath>]?path: string, [<CallerLineNumber>]?line: int) (value: string) =
printfn "%A" (key, path, line)
let t = A()
t["a"]
Related information
Provide any related information (optional):
- .NET Runtime kind: .NET 11
- Editing Tools: dotnet fsi
F#'s Indexer setters don't work with optional parameters, but C#'s do.
Related #9369
Repro steps
Related information
Provide any related information (optional):