Skip to content

Struct field docstrings do not work for const fields of mutable structs #58820

Open
@lhupe

Description

@lhupe

const fields of mutable structs cannot be annotated with docstrings in the same way as mutable fields, e.g.

"a struct docstring"
mutable struct SomeStruct
    "a field docstring"
    mutablefield
    "another field docstring"
    const constfield
end

results in the following behaviour (tested on v1.11.5 and 1.12.0-beta4)

help?> SomeStruct.mutablefield
  a field docstring

help?> SomeStruct.constfield
  SomeStruct has fields mutablefield, and constfield.

This issue has already been filed with DocStringExtensions (JuliaDocs/DocStringExtensions.jl#155) back in September '24, but it's definitely a Julia problem and I can't find any previous issues here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsystemThe documentation building system

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions