Skip to content

Signature file generation does not handle arguments in attributes #13759

@nojaf

Description

@nojaf

When generating a signature file from a type with attributes with arguments, the generated code does not contain any arugments.

Repro steps

namespace MyApp.Types

open Newtonsoft.Json
    
type SomeTypeName =
    {
        /// Some Xml doc
        FieldOne : string
        [<JsonProperty(Required=Required.Default)>]
        FieldTwo : string list
        /// Some other Xml doc
        [<JsonProperty(Required=Required.Default)>]
        FieldThree : string
    }

leads to

namespace MyApp.Types
    
    type SomeTypeName =
        {
          
          /// Some Xml doc
          FieldOne: string
          [<Newtonsoft.Json.JsonProperty>]
          FieldTwo: string list
          
          /// Some other Xml doc
          [<Newtonsoft.Json.JsonProperty>]
          FieldThree: string
        }

Expected behaviour

The generated signature should be considered equivalent to the backing source file.

Actual behaviour

The generated code isn't valid, warning in implementation file:

image

Known workarounds

Edit signature file by hand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions