Skip to content

Tests fail on Julia 1.13: keyword-only anonymous function in test/problems/goddard.jl #996

Open

Description

@ocots

The tests fail on Julia 1.13 with a syntax error in test/problems/goddard.jl, line 82:

return function (; hamiltonian_type::Symbol=:total)
LoadError: syntax: invalid assignment location "hamiltonian_type::Symbol = :total" around test/problems/goddard.jl:82

An anonymous function whose arguments are keywords only is rejected by the 1.13 parser. The error hits every test file that includes the Goddard problem: suite/builders/test_options_forwarding.jl, suite/indirect/test_shooting_sweep.jl, suite/problems/test_forms_equivalent.jl, suite/problems/test_hamiltonian_type.jl.

Seen in the CI of main (the 1.13 jobs fail, 1.10 passes) and in the breakage suite of CTBase, on main and on v2.2.1-beta: https://github.com/control-toolbox/CTBase.jl/actions/runs/39232998112. Since version: 1 now resolves to 1.13, every job on 1 fails too.

Fix: give the closure a name, which the parser accepts on every version, e.g.

shoot(; hamiltonian_type::Symbol=:total) = begin ... end
return shoot

or the arrow form (; hamiltonian_type::Symbol=:total) -> .... Worth a search for the same pattern elsewhere in test/ and src/.

🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

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