Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature file generation does not handle arguments in attributes #13759

Closed
nojaf opened this issue Aug 23, 2022 · 2 comments · Fixed by #13891
Closed

Signature file generation does not handle arguments in attributes #13759

nojaf opened this issue Aug 23, 2022 · 2 comments · Fixed by #13891
Labels
Area-Compiler-SigFileGen generation of signature files - both compiler and IDE Bug
Milestone

Comments

@nojaf
Copy link
Contributor

nojaf commented Aug 23, 2022

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.

@alfonsogarciacaro
Copy link
Contributor

alfonsogarciacaro commented Aug 26, 2022

I'm seeing something similar in Fable, suddenly FCS doesn't expose the attributes of arguments of FSharpMemberOrFunctionOrValue. Note in my case it's an implementation file and the typed AST.

@alfonsogarciacaro
Copy link
Contributor

Sorry ignore previous comment, that was not related to this issue. I've reported a new one: #13786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-SigFileGen generation of signature files - both compiler and IDE Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants