# Error: "all-underscore identifier used as rvalue"

**URL:** https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944
**Category:** General Usage
**Created:** [April 26, 2023, 1:08pm UTC](https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944 "2023-04-26T13:08:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)
#### Post date: [April 26, 2023, 1:08pm UTC](https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944/1 "2023-04-26T13:08:57Z")

</div>

I am trying to understand why the following error is thrown:

```julia
julia> function foo1(x, _, y; z)
         @show x, y, z
       end
ERROR: syntax: all-underscore identifier used as rvalue around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

julia> function foo1(x, _, y)
         @show x, y
       end
foo1 (generic function with 1 method)

```

Note that the `_` argument is not used in `foo1`.  
Also note that the error disappears when there are no keyword arguments.  
What is going on here?

---

<div class="post-metadata">

### Author: ![mikmoore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikmoore/32/31109_2.png) [@mikmoore](https://discourse.julialang.org/u/mikmoore)
#### Post date: [May 1, 2023, 3:25pm UTC](https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944/2 "2023-05-01T15:25:01Z")

</div>

A function with keyword arguments creates a hidden helper function that places all the keyword arguments into a positional function call. Something vaguely like

```julia
function foo1(x, _, y; z)
  z_positional = z
  _foo1_internal(x, _, y, z_positional) # <-- the problem arises here
end

function _foo1_internal(x, _, y, z)
  @show x,y,z
end

```

So the issue is that it isn’t being very smart with the helper function and is trying to forward the `_` argument. This means it shows up as a value on the right hand side of a statement (“rvalue”) and you get the confusing error that you saw.

There’s an open issue for this [#32727](https://github.com/JuliaLang/julia/issues/32727) but it hasn’t been addressed yet.
