JuliaLang/julia

"@inferred requires a call expression" for do notation

Open

#59.114 aperta il 28 lug 2025

Vedi su GitHub
 (8 commenti) (0 reazioni) (0 assegnatari)Julia (5773 fork)batch import
good first issue

Metriche repository

Star
 (48.709 star)
Metriche merge PR
 (Merge medio 23g 11h) (145 PR mergiate in 30 g)

Descrizione

Lambda functions work fine, while the same do-block throws an error:

julia> using Test

julia> @inferred map(x->x, [1,2])
2-element Vector{Int64}:
 1
 2

julia> @inferred map([1,2]) do x
       x
       end
ERROR: LoadError: @inferred requires a call expression

Guida contributor