Skip to content

New formatting turns optional positional argument into keyword argument #878

@gdalle

Description

@gdalle

Kudos on the full rewrite!
Unfortunately I have encountered a bug when I tried to apply the new formatting in JuliaDiff/DifferentiationInterface.jl#589. An unnamed, Val-typed positional argument was "formatted" into a keyword argument (see this comment).

Schematically, the following code

function f(x, y, ::Val{N}=Val(1)) where {N}

turned into (note the semicolon)

function f(x, y; (::Val{N})=Val(1)) where {N}

which changed the semantics.

EDIT: As discussed below, this apparently applied to all optional positional arguments, named or not. It might be due to BlueStyle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions