`ẋ(t) = …` (single `=`) in `@def`: the error echoes the lowered block and says "forbidden alias name"

Aperta
#353 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jbcaillau ci sta già lavorando.

Dal 9/10/2026.

  • #395 di @ocots — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

Problem

Writing the dynamics with = instead of == is a common slip. The error does not say so. It echoes the lowered expression, including a #= file:line =# node, and reports "forbidden alias name".

Reproducer

CTParser through OptimalControl 2.2.1-beta:

using OptimalControl
@def begin
    tf ∈ R, variable
    t ∈ [0, tf], time
    x = (q, v) ∈ R², state
    u ∈ R, control
    q̇ = v
    v̇ = u
    ẋ(t) = [q̇, v̇]
end
ParsingError
│  Line 7: ẋ(t) = begin
│          #= /path/to/file.jl:26 =#
│          [q̇, v̇]
│      end
│  forbidden alias name: (∂(x))(t)
└─

Expected

Detect an alias whose left-hand side is a derivative of the state (ẋ(t), ∂(x)(t), derivative(x)(t)), and say: "use == for the dynamics: ẋ(t) == …". Show the line as the user wrote it, without the begin #= … =# end wrapper. The wrapper also leaks a local path into built documentation.

Lingua principale
Julia
Stelle
3
Fork
0
Merge medio
1g 32m
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di control-toolbox/CTParser.jl

Tutte le issue di control-toolbox/CTParser.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.