File tree Expand file tree Collapse file tree
tests/FSharp.Compiler.ComponentTests/Language Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,3 +207,34 @@ type B = { [<DefaultValue([||] : A[])>] BField: A[] }
207207 |> asLibrary
208208 |> compile
209209 |> shouldSucceed
210+
211+ // https://github.com/dotnet/fsharp/issues/12796
212+ [<Fact>]
213+ let ``Issue 12796 - Empty array of enum type in attribute should succeed`` () =
214+ FSharp
215+ """
216+ module TestModule
217+
218+ type MyEnum = A = 0 | B = 1
219+ type MyAttr(v: obj) = inherit System.Attribute()
220+ type T = { [<MyAttr([||] : MyEnum[])>] F: int }
221+ """
222+ |> asLibrary
223+ |> compile
224+ |> shouldSucceed
225+
226+ // https://github.com/dotnet/fsharp/issues/12796
227+ [<Fact>]
228+ let ``Issue 12796 - Empty array of primitive type in attribute should succeed`` () =
229+ FSharp
230+ """
231+ module TestModule
232+
233+ type MyAttr(v: int[]) = inherit System.Attribute()
234+ type T = { [<MyAttr([||])>] F: int }
235+ """
236+ |> asLibrary
237+ |> compile
238+ |> shouldSucceed
239+
240+
You can’t perform that action at this time.
0 commit comments