In C #, I can do this:
[InlineData(new [] { "foo" })]
When I try to do this in F #:
[<InlineData([| "foo" |])>]
This gives me a compilation error:
This is not a valid constant expression or custom attribute value
Am I doing something wrong or does F # not support arrays as attribute parameters?
UPDATE
The problem is with the attribute signature:
InlineDataAttribute(params dataValues: obj[]) : unit
The goal is to pass a string array as one element in a params array.
source
share