Skip to content

v1.11: Cannot shadow exports with a hand-typed function definition #58342

@mbauman

Description

@mbauman

In v1.10, I could write a function definition that shadows a Base name:

▶ julia +1.10 -q
julia> sin() = 2
sin (generic function with 1 method)

julia> sin()
2

In v1.11, however, I cannot if I manually type this in:

▶ julia +1.11 -q
julia> sin() = 2
ERROR: invalid method definition in Main: function Base.sin must be explicitly imported to be extended

If, however, I paste sin() = 2 at the REPL or use history navigation to get to it, then I can do this. I assume it's a problem with tab completion.

Binding resolution all changed on v1.12+, of course, so I'm not sure if the fundamental issue here was resolved or if we're just happily rebinding things... but it seems like manually typing this doesn't change the partition_kind at least.

Metadata

Metadata

Assignees

No one assigned

    Labels

    REPLJulia's REPL (Read Eval Print Loop)bugIndicates an unexpected problem or unintended behaviorcompletionsTab and autocompletion in the repl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions