Add regression test: #12796, DefaultValue null on array type record field#19472
Add regression test: #12796, DefaultValue null on array type record field#19472
Conversation
|
| open System.ComponentModel | ||
|
|
||
| type A = { AField: string } | ||
| type B = { [<DefaultValue(null)>] BField: A[] } |
There was a problem hiding this comment.
Big NO, the issue really says:
[<DefaultValue([||] : A[])>]
|
Commit pushed:
|
This comment has been minimized.
This comment has been minimized.
|
Commit pushed:
|
|
🤖 This is an automated response from Regression PR Shepherd. This regression test proves the bug in #12796 still exists on Desktop .NET Framework. Closing this PR is recommended. The bug: The test: The failure: The cc
|
c9f9eb2 to
929e77c
Compare
|
I don't get why we would have problems encoding empty arrays of any type? It does not matter if we cannot store instances of that type, since it is empty. If we can store a string array, an empty string array, why also not an arbitrary empty array? |
a5a1e73 to
a0a1a5d
Compare
9799996 to
a530e0f
Compare
|
@copilot : See my comment above. Research implementation changes needed to support empty arrays as default values, and develop using TDD (via ComponentTests. Since this is IL specific, make sure to use "compileAndRun" and also use the helper for "ilverify" of the compiled code in that test. |
Head branch was pushed to by a user without write access
Implementation complete in commit Implementation changes:
Tests (all using compile → verifyPEFileWithSystemDlls → run pipeline):
All 97 AttributeCheckingTests pass. |
Empty arrays of non-encodable types (classes, records, structs) in custom attributes now compile successfully by encoding them as System.Object[] per ECMA-335. Non-empty arrays of such types produce FS3885 instead of the internal error FS0192. Changes: - IlxGen.fs: detect unencodable element types in array attribute args - il.fs: add 0x51 (SERIALIZATION_TYPE_TAGGED_OBJECT) decoder - FSComp.txt: new diagnostic FS3885 - Tests: 7 new AttributeCheckingTests (compile + ILVerify + run) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9eb3406 to
2c9749a
Compare
Fixes #12796
Adds a regression test verifying that
[<DefaultValue(null)>]on a record field of typeA[]compiles successfully without internal error FS0192.