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

TAB completion on REPL makes identifier confliction #23677

Closed
appleparan opened this issue Sep 12, 2017 · 8 comments
Closed

TAB completion on REPL makes identifier confliction #23677

appleparan opened this issue Sep 12, 2017 · 8 comments
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@appleparan
Copy link

appleparan commented Sep 12, 2017

This is from FFTW.jl issue #36

TAB completion on REPL, especially using using statement for module, seems loading identifier once again.

As I said on this, using TAB completion even using Base makes FFTW identifier confliction error.

root@67c40e951d84:~# julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.1568 (2017-08-29 23:34 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 881ab49 (13 days old master)
|__/                   |  x86_64-pc-linux-gnu

julia> using Base

julia> using FFTW
WARNING: error while reinitializing value FFTW:
ErrorException("cannot assign variable DFT.FFTW from module Main")
WARNING: requiring "FFTW" in module "Main" did not define a corresponding module.

julia>

I think this line of deprecated.jl makes Julia load the identifier again. Do we need to change deprecated macro usage or change TAB completion?

@stevengj
Copy link
Member

I'm guessing that this is a problem with tab completion and how it searches through modules.

@appleparan
Copy link
Author

appleparan commented Sep 12, 2017

Yeah, FFTW symbols should not be searched on REPL tab completion via Base.isdeprecated, but it is included because of deprecated.jl

Is it possible to remove using symbols on deprecated.jl? @ararslan

@stevengj
Copy link
Member

Maybe if we call Base.deprecate(Base, :DFT, 2) and update the completion code somewhere to look for the deprecation flag...?

@stevengj
Copy link
Member

stevengj commented Sep 12, 2017

A non-interactive way to reproduce the warning:

julia> Base.REPLCompletions.completions("using Base", 10)
(["Base"], 7:10, true)

julia> using FFTW
WARNING: error while reinitializing value FFTW:
ErrorException("cannot assign variable DFT.FFTW from module Main")
WARNING: requiring "FFTW" in module "Main" did not define a corresponding module.

@ararslan
Copy link
Member

It's tempting, now that packages have had a chance to adopt FFTW.jl, to remove the structure I put in place in base/deprecated.jl that preserves the Base.DFT.FFTW module hierarchy. That was so that code calling into the module (e.g. to access FFT flags) wouldn't be suddenly broken. We could keep the deprecations for the symbols that were exported from Base, e.g. fft and ifft, at the top level and instead add FFTW and DFT to the special cases in the showerror method for UndefVarError.

@stevengj
Copy link
Member

If you remove it, then code will be suddenly broken when people upgrade to 0.7, which seems to be contrary to our usual deprecation practice.

In any case, it seems like it would be good to fix this. I don't think DFT will be the last module that gets moved out of Base.

@JeffBezanson
Copy link
Member

Maybe fixed by #29962?

@KristofferC
Copy link
Member

Let's assume it is and reopen / new issue if it comes up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

5 participants