JuliaLang/julia

"@inferred requires a call expression" for do notation

Open

#59,114 建立於 2025年7月28日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)Julia (48,709 star) (5,773 fork)batch import
good first issue

描述

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

貢獻者指南