Skip to content

FIELDS / TYPEDFIELDS fail on const fields of mutable struct #155

Closed
@i9e1

Description

@i9e1

Since v"1.8.0" its possible to annotate a mutable struct's field with the const keyword.

If you do, DocStringExtensions FIELDS, TYPEDFIELDS fail: docstrings are only parsed for mutable fields.
Here is a MWE tested with julia v"1.9.2" and DocStringExtenions v"0.9.3".

julia> """Minimal Working Example to demonstrate `const` keyword on mutable struct with fields $(FIELDS) and typed $(TYPEDFIELDS)"""
       mutable struct MWE
           "This is not shown"
           const a::Real
           "This works as it should"
           b::Real
       end;

julia>

help?> MWE
search: MWE

  Minimal Working Example to demonstrate const keyword on mutable struct with fields

    •  a

    •  b: This works as it should

  and typed

    •  a::Real

    •  b::Real: This works as it should

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