Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

erroneous "conflicts with an existing identifier" warning? #2760

Closed
vtjnash opened this Issue · 4 comments

4 participants

@vtjnash
Collaborator

After causing a "not defined" error from a function, that symbol seems to be an odd pseudo-defined state, so that I can't easily fix my error by "using" the correct module. (I can work around it by doing const plot = Winston.plot)

julia> f() = plot() #some utility function that uses plot()

julia> f() #oops, forgot to add winston before calling f()
ERROR: in f: plot not defined
 in f at none:1

julia> using Winston #ok, but what is this?
Warning: using Winston.plot in module Main conflicts with an existing identifier.

julia> plot #huh? now what?
ERROR: plot not defined
@JeffBezanson
Owner

This happens because binding resolution (deciding where a global will be stored) is a separate step from actually assigning a value. By calling f(), you're forcing it to pick a location for plot, so it creates a global in the current module.

@kmsquire
Collaborator

I was just about to refile this issue, since I've run into it frequently. @JeffBezanson, that's a descriptive answer, but does that mean this behavior is not fixable, or just that it's difficult to fix? Should this be labeled "won't fix"?

@glwhart

I ran into the same problem when trying to use the iterators module:

julia> for i in product(1:2,1:2)
       @show i
       end
ERROR: product not defined
 in anonymous at no file

julia> using Iterators
Warning: using Iterators.product in module Main conflicts with an existing     identifier.

Is this something that will be fixed eventually, or will we just have to always be careful to use using first?

@JeffBezanson

This is issue #7864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.