JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.4k stars 5.45k forks source link

Dot broadcast doesn't work with `do ... end` #54039

Open prbzrg opened 4 months ago

prbzrg commented 4 months ago
julia> map(ones(3)) do x
       x
       end
3-element Vector{Float64}:
 1.0
 1.0
 1.0

julia> map.(ones(3)) do x
       x
       end
ERROR: ParseError:
# Error @ REPL[5]:1:14
map.(ones(3)) do x
#            └───┘ ── extra tokens after end of expression
Stacktrace:
 [1] top-level scope
   @ none:1
Julia Version 1.10.2
Commit bd47eca2c8 (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 12 default, 2 interactive, 7 GC (on 12 virtual cores)
prbzrg commented 4 months ago

Is this intended?