Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Add missing LineNumberNode to @swappable call (fixes #257) #259

Merged
merged 3 commits into from
May 30, 2017
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ macro dataarray_binary_scalar(vectorfunc, scalarfunc, outtype, swappable)
if swappable
# For /, Array/Number is valid but not Number/Array
# All other operators should be swappable
map!(x->Expr(:macrocall, Symbol("@swappable"), LineNumberNode(@__LINE__), x, scalarfunc), fns, fns)
if VERSION < v"0.7.0-"
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if you could identify the exact commit which broke this (use contrib/commit-name.sh).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is the exact commit is: 0.7.0-DEV.328 . Specifically, JuliaLang/julia@fcdf437

Copy link
Contributor

@tkelman tkelman May 30, 2017

Choose a reason for hiding this comment

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

You should use the merge commit JuliaLang/julia@9e3318c. Its master parent commit, JuliaLang/julia@8b2cac4, is 0.7.0-DEV.353 but does not have this change.

Copy link
Member

Choose a reason for hiding this comment

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

Damn, everybody gets this wrong at least once. Do you think the script could do this automatically?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could maybe have it do some git operations to try to figure out whether the commit it runs on is a merge (or squash merge) commit or something from a PR branch and give a warning, but I'm not sure what to check for

Copy link
Contributor

Choose a reason for hiding this comment

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

If github would fix "rebase and merge" to include a reference to the PR number, we could switch to that for multi-commit PR's and disable the normal merge commit option. Single-commit PR's should almost always be squash merged since there's no reason not to, so it's only multi-commit PR's where there's a risk of VERSION getting things wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

did this get fixed?

Copy link
Member

Choose a reason for hiding this comment

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

No, but see #264.

map!(x->Expr(:macrocall, Symbol("@swappable"), x, scalarfunc), fns, fns)
else
map!(x->Expr(:macrocall, Symbol("@swappable"), LineNumberNode(@__LINE__), x, scalarfunc), fns, fns)
end
end
Expr(:block, fns...)
end
Expand Down