This was noted while updating Benchmark.Net library. DisassemblyDiagnoser attribute got a new "params string[]" parameter at the end. This actually broke compilation for my F# benchmarks.
As a workaround it's enough to specify only 1 parameter value. Otherwise compiler is unable to construct an object.
Tested in Rider 2022.2.4 (fcs before F# 7) amd in Visual Studio Community Version 17.4.0 Preview 3.0 (I guess with F#7 but I can be wrong)
Repro:
type DefaultAndParams([<Optional; DefaultParameterValue(1)>]x: int, [<ParamArray>] value: string[]) =
inherit Attribute()
type ParamsOnly([<ParamArray>] value: string[]) =
inherit Attribute()
type DefaultOnly([<Optional; DefaultParameterValue(1)>]x: int) =
inherit Attribute()
// The object constructor 'DefaultAndParams' takes 2 argument(s) but is here given 0. The required signature is 'new: x: int * [<ParamArray>] value: string[] -> DefaultAndParams'.
[<DefaultAndParams>]
type Q1 = struct end
[<DefaultAndParams(x = 1)>] // ok
type Q11 = struct end
[<DefaultAndParams(value = [||])>] // ok
type Q12 = struct end
[<ParamsOnly>]
type Q2 = struct end
[<DefaultOnly>]
type Q3 = struct end
This was noted while updating Benchmark.Net library. DisassemblyDiagnoser attribute got a new "params string[]" parameter at the end. This actually broke compilation for my F# benchmarks.
As a workaround it's enough to specify only 1 parameter value. Otherwise compiler is unable to construct an object.
Tested in Rider 2022.2.4 (fcs before F# 7) amd in Visual Studio Community Version 17.4.0 Preview 3.0 (I guess with F#7 but I can be wrong)
Repro: