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

ambiguous soft scope warning on anonymous object in version 1.5.0 #37126

Closed
kyungminlee opened this issue Aug 20, 2020 · 1 comment
Closed

ambiguous soft scope warning on anonymous object in version 1.5.0 #37126

kyungminlee opened this issue Aug 20, 2020 · 1 comment
Assignees
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version

Comments

@kyungminlee
Copy link

In Julia 1.5.0, I get a warning about ambiguous scoping of an anonymous object. Following is the shortest code I have found to reproduce this issue:

julia> include("f.jl")
┌ Warning: Assignment to `#s17` in soft scope is ambiguous because a global variable by the same name exists: `#s17` will be treated as a new local. Disambiguate by using `local #s17` to suppress this warning or `global #s17` to assign to the existing global variable.
└ @ C:\Users\kyungminlee\Code\soft-scope\f.jl:6

where f.jl is

function foo()
    f(lhs::Integer, rhs::Integer) = nothing
    f(lhs::Integer, rhs::AbstractVector{<:Integer}) = nothing
    return f
end
struct Bar{T<:Real, P<:Real} end

This only seems to happen when I do include: no warning is thrown when I put the code in a module and import it, or just type it in the repl.

julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
@KristofferC KristofferC added kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version labels Aug 20, 2020
@fredrikekre
Copy link
Member

@JeffBezanson JeffBezanson self-assigned this Aug 24, 2020
@JeffBezanson JeffBezanson added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Aug 24, 2020
KristofferC pushed a commit that referenced this issue Aug 26, 2020
@KristofferC KristofferC mentioned this issue Aug 26, 2020
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

4 participants