Why `@code_lowered (1,2,3) .+ 1` returns error?


#1
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> (1,2,3) .+ 1
(2, 3, 4)

julia> @code_lowered (1,2,3) .+ 1
ERROR: UndefVarError: .+ not defined
Stacktrace:
 [1] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/InteractiveUtils/src/macros.jl:118

#2

#3

Is there any walkaround to see the lowered form of this expression. In theory I should get object of type Broadcasted(+, (1,2,3), 1). Or perhaps a function broadcasted with the same arguments.


#4
julia> Meta.lower(Main, :((1,2,3) .+ 1))
:($(Expr(:thunk, CodeInfo(
 1 ─ %1 = (Base.getproperty)(Base.Broadcast, :materialize)                                         │
 │   %2 = (Base.getproperty)(Base.Broadcast, :broadcasted)                                         │
 │   %3 = (Core.tuple)(1, 2, 3)                                                                    │
 │   %4 = (%2)(+, %3, 1)                                                                           │
 │   %5 = (%1)(%4)                                                                                 │
 └──      return %5                                                                                │
))))

julia> f() = (1,2,3) .+ 1
f (generic function with 1 method)

julia> @code_lowered f()
CodeInfo(
1 1 ─ %1 = Base.Broadcast.materialize                                                              │
  │   %2 = Base.Broadcast.broadcasted                                                              │
  │   %3 = (Core.tuple)(1, 2, 3)                                                                   │
  │   %4 = (%2)(Main.:+, %3, 1)                                                                    │
  │   %5 = (%1)(%4)                                                                                │
  └──      return %5                                                                               │
)