Skip to content

dotted getindex has wrong error in the REPL #26739

@KristofferC

Description

@KristofferC

This looks odd (this has now been fixed):

jjulia> sum.[1]
ERROR: MethodError: no method matching getproperty(::typeof(sum), ::Expr)
Closest candidates are:
  getproperty(::Any, ::Symbol) at sysimg.jl:18

julia> Base.getproperty(::typeof(sum), ::Expr) = "Hello"

julia> sum.[1]
"Hello"

julia> foo() = sum.[1]
ERROR: syntax: invalid syntax sum.[1]

Also (not fixed):

julia> sum.[1]
ERROR: MethodError: no method matching getproperty(::typeof(sum), ::Expr)
Closest candidates are:
  getproperty(::Any, ::Symbol) at sysimg.jl:18

julia> Base.getproperty(::typeof(sum), ::Expr) = "Hello"

julia> sum.[1]
"Hello"

julia> foo() = sum.[1]
ERROR: syntax: invalid syntax sum.[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions