Skip to content

internal error : encodeCustomAttrElemType: unrecognized custom element type #12796

@brianberns

Description

@brianberns

Repro steps

Compile this program:

open System.ComponentModel

type A =
    {
        AField : string
    }

type B =
    {
        [<DefaultValue([||] : A[])>]
        BField : A[]
    }

This construct is used, for example, by Newtonsoft Json.NET.

Expected behavior

Compiles successfully.

Actual behavior

Internal compiler error:

error FS0192 : internal error : encodeCustomAttrElemType: unrecognized custom element type

Known workarounds

None

Related information

Windows, .NET 6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingArea-Compiler-Checking-AttributesAttribute targets, AllowMultiple, CompiledName, custom attribute encodingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions