Skip to content

StructuredFormatDisplay is not used by formatted strings #4880

Description

@weebs
type [<StructuredFormatDisplay("{Display}")>] Foo = 
    { a: int }
    with
    member this.Display = $"Foo {{ a = {this.a} }}"

let foo = { a = 1337 }

printfn $"{foo}"

Same behavior for printfn "%A" foo

node Program.fs.js
{ a = 1337 }

dotnet run
Foo { a = 1337 }

I ran into this with a cyclic data structure in my project that causes the Fable formatter to throw. I wouldn't mind taking a look at this myself when I have time but wanted to document the case since I hadn't seen any other issues for it yet

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions