Skip to content

Commit

Permalink
fix #28044, collision between global and where-bound var
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 11, 2018
1 parent 3791357 commit 6629796
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/jlfrontend.scm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
tab)))
((lambda) tab)
((local) tab)
((scope-block) tab)
((break-block) (find-possible-globals- (caddr e) tab))
((module toplevel) '())
(else
Expand Down
11 changes: 11 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1559,3 +1559,14 @@ let oldstderr = stderr, newstderr, errtxt
end
@test occursin("WARNING: local variable B conflicts with a static parameter", fetch(errtxt))
end

# issue #28044
code28044(x) = 10x
begin
function f28044(::Val{code28044}) where code28044
code28044(2)
end
# make sure this assignment to `code28044` doesn't add an implicit-global
Val{code28044} where code28044
end
@test f28044(Val(identity)) == 2

0 comments on commit 6629796

Please sign in to comment.