Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,14 @@ function is_simply_call(@nospecialize ex)
Meta.isexpr(a, :..., 1) && is_simple_atom(a.args[1]) && continue
return false
end
# Ensure Expr(:call, .+, ...) get wrapped
if ex.args[1] isa Symbol
sa = String(ex.args[1]::Symbol)
startswith(sa, ".") &&
!endswith(sa, ".") &&
isoperator(Symbol(sa[2:end])) &&
return false
end
return true
end

Expand Down
3 changes: 3 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,9 @@ end
@allocated _x = 1+2
@test _x === 3

# test `@allocated` works for dotted operations
@test (@allocated 1 .+ 1) == 0

n, m = 10, 20
X = rand(n, m)
treshape59278(X, n, m)
Expand Down