Skip to content

Commit

Permalink
Compat flag for adding source location argument to macros
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed May 10, 2017
1 parent 594fafc commit 90d06f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ for `HermOrSym` such that using the new methods are backward compatible.

* Single-argument `min`, `max` and `minmax` are defined on 0.4.

* The `Expr(:macrocall)` has an extra initial argument `__source__`, which can be tested for with `Compat.macros_have_sourceloc`.

## New types

Currently, no new exported types are introduced by Compat.
Expand Down
3 changes: 3 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1494,4 +1494,7 @@ end

include("to-be-deprecated.jl")

# https://github.com/JuliaLang/julia/pull/21746
const macros_have_sourceloc = VERSION >= v"0.7-" && length(:(@test).args) == 2

end # module Compat

0 comments on commit 90d06f7

Please sign in to comment.