Skip to content

Commit

Permalink
🐦 Fixed #320
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Aug 27, 2020
1 parent d4be9bf commit f7ec03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/analysis/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,8 @@ end
function explore!(ex::Expr, scopestate::ScopeState)::SymbolsState
if ex.head == :(=)
# Does not create scope


if ex.args[1] isa Expr && (ex.args[1].head == :call || ex.args[1].head == :where)
if ex.args[1] isa Expr && (ex.args[1].head == :call || ex.args[1].head == :where || (ex.args[1].head == :(::) && ex.args[1].args[1] isa Expr && ex.args[1].args[1].head == :call))
# f(x, y) = x + y
# Rewrite to:
# function f(x, y) x + y end
Expand Down
5 changes: 4 additions & 1 deletion test/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,16 @@ using Test
@test testee(:(function f(y::Int64=a)::String string(y) end), [], [], [], [
:f => ([:String, :Int64, :a], [], [:string], [])
])
@test testee(:(f(a::A)::C = a.a;), [], [], [], [
:f => ([:A, :C], [], [], [])
])
@test testee(:(function f(x::T; k=1) where T return x + 1 end), [], [], [], [
:f => ([], [], [:+], [])
])
@test testee(:(function f(x::T; k=1) where {T,S <: R} return x + 1 end), [], [], [], [
:f => ([:R], [], [:+], [])
])
@test_broken testee(:(f(x)::String = x), [], [], [], [
@test testee(:(f(x)::String = x), [], [], [], [
:f => ([:String], [], [], [])
])
@test testee(:(MIME"text/html"), [], [], [Symbol("@MIME_str")], [])
Expand Down

3 comments on commit f7ec03d

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on f7ec03d Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on f7ec03d Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/20371

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.9 -m "<description of version>" f7ec03dbac8d46208cba6e600fd6d513f82b71c3
git push origin v0.11.9

Please sign in to comment.