JuliaLang / JuliaLang/JuliaSyntax.jl
Interpolated `getproperty` syntax error
- Dominant language
- Julia
- Stars
- 293
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
I am seeing the following unexpected behavior with Julia version 1.10.2:
```
julia> foo(x) = x.:($(1 + 2)) + 0
ERROR: syntax: invalid syntax "x.((1 + 2))" around REPL[1]:1
Stacktrace:
[1] top-level scope
@ REPL[1]:1
julia> foo(x) = x.:($(1 + 2)) += 0
ERROR: syntax: invalid syntax "x.(SSAValue(9))" around REPL[2]:1
Stacktrace:
[1] top-level scope
@ REPL[2]:1
julia> foo(x) = x.:($(1 + 2)) .+= 0
ERROR: syntax: invalid syntax "x.(SSAValue(16))" around REPL[3]:1
Stacktrace:
[1] top-level scope
@ REPL[3]:1
julia> foo(x) = x.:($(1 + 2)) .= 0
foo (generic function with 1 method)
```
All of these definitions work when they are written out as calls to `getproperty`, so it looks like this is hitting some uncaught edge case for expression interpolation.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.