Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"error in method definition" when using A: f used after import A: f #38787

Open
rfourquet opened this issue Dec 9, 2020 · 1 comment
Open
Labels
kind:minor change Marginal behavior change acceptable for a minor release modules

Comments

@rfourquet
Copy link
Member

rfourquet commented Dec 9, 2020

Sorry for the unexpressive title
MWE:

julia> module A
       function f end
       end

       module O
       import ..A: f
       using ..A: f

       f(x) = 0
       end
ERROR: error in method definition: function A.f must be explicitly imported to be extended
Stacktrace:
[...]

The error is fixed by deleting the using ..A: f line.
The problem is that if the using and import statements are in different files, it's not trivial to make sense of the error message when the thing you are looking at is the above import statement.

@mgkuhn mgkuhn added the modules label Dec 9, 2020
@JeffBezanson
Copy link
Sponsor Member

I guess the best thing to do here is give an error if a using follows an import (or vice-versa) of the same identifier.

@JeffBezanson JeffBezanson added the kind:minor change Marginal behavior change acceptable for a minor release label Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:minor change Marginal behavior change acceptable for a minor release modules
Projects
None yet
Development

No branches or pull requests

3 participants