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

Fix dot-evaluation fast path #26742

Merged
merged 1 commit into from
Apr 7, 2018
Merged

Fix dot-evaluation fast path #26742

merged 1 commit into from
Apr 7, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Apr 7, 2018

Broadcast calls like sin.(x) are parsed to

Expr(:(.), :sin, Expr(:tuple, :x))

before lowering. As a result, they got caught in the
top-level interpreters fast path for lowering calls
like that to getfield/getproperty, causing #26739.

Fixes #26739

Broadcast calls like `sin.(x)` are parsed to

    Expr(:(.), :sin, Expr(:tuple, :x))

before lowering. As a result, they got caught in the
top-level interpreters fast path for lowering calls
like that to getfield/getproperty, causing #26739.

Fixes 26739
@Keno Keno requested review from vtjnash and stevengj April 7, 2018 18:55
@Keno Keno merged commit a96d847 into master Apr 7, 2018
@stevengj stevengj deleted the kf/fixdotfastpath branch April 7, 2018 22:29
@JeffBezanson
Copy link
Member

It's not great that we have to replicate part of lowering here. Why is this needed? Maybe we can narrow the logic even more, accepting only a.b in the fast path.

@Keno
Copy link
Member Author

Keno commented Apr 9, 2018

This particular PR is needed to fix the referenced issue. Why the fast-path is needed, you'll have to ask @vtjnash.

@fredrikekre
Copy link
Member

Is this also related to the fast path for .:

julia> sum.[1]
ERROR: MethodError: no method matching getproperty(::typeof(sum), ::Expr)
Closest candidates are:
  getproperty(::Any, ::Symbol) at sysimg.jl:18

julia> Base.getproperty(::typeof(sum), ::Expr) = "Hello"

julia> sum.[1]
"Hello"

julia> foo() = sum.[1]
ERROR: syntax: invalid syntax sum.[1]

It is a bit weird at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants