Skip to content

Incorrect implicit ambiguity resolution #57404

Closed
@Keno

Description

@Keno

Here is another MWE for (#57328 (comment)) here for https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/7825364_vs_d63aded/BrillouinZoneMeshes.primary.log:

module M
    module A
        export S
    end
    using .A
    module B
        abstract type S end
        export S
    end
    using .B
    S
end

During package precompilation you don't really get a good error message but pasting into the REPL you see

ERROR: UndefVarError: `S` not defined in `Main.M`
Hint: It looks like two or more modules export different bindings with this name, resulting in ambiguity. Try explicitly importing it from a particular module, or qualifying the name with the module it should come from.

(And no, I don't know why people write their code like this...)

Originally posted by @KristofferC in #57328

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions