JuliaLang/julia

"@inferred requires a call expression" for do notation

Open

#59,114 创建于 2025年7月28日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)Julia (5,773 fork)batch import
good first issue

仓库指标

Star
 (48,709 star)
PR 合并指标
 (平均合并 20天 6小时) (30 天内合并 157 个 PR)

描述

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

贡献者指南