Skip to content

Function documentation ignored when not at toplevel #14962

@nalimilan

Description

@nalimilan

If you save the following code to a file and include() it, neither ?f nor ?g will print any documentation. Removing the if fixes the problem. This is annoying when only adding a function depending on the Julia version, notably when extending a Base function which may not exist in older releases.

if false
    """
    Do something funny.
    """
    f(x) = 1
else
    """
    Do something sad.
    """
    g(x) = 1
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsystemThe documentation building system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions