Skip to content

Commit

Permalink
fix #15718, comparing Exprs containing NaNs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 22, 2016
1 parent de6468b commit 40031f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/expr.jl
Expand Up @@ -42,8 +42,8 @@ astcopy(x::Union{Slot,Expr}) = copy(x)
astcopy(x::Array{Any,1}) = Any[astcopy(a) for a in x]
astcopy(x) = x

==(x::Expr, y::Expr) = x.head === y.head && x.args == y.args
==(x::QuoteNode, y::QuoteNode) = x.value == y.value
==(x::Expr, y::Expr) = x.head === y.head && isequal(x.args, y.args)
==(x::QuoteNode, y::QuoteNode) = isequal(x.value, y.value)
==(x::Slot, y::Slot) = x.id === y.id && x.typ === y.typ

expand(x::ANY) = ccall(:jl_expand, Any, (Any,), x)
Expand Down
4 changes: 4 additions & 0 deletions test/core.jl
Expand Up @@ -3776,3 +3776,7 @@ end
@m
end
@test Macro_Yielding_Global_Assignment.x == 2

# issue #15718
@test :(f($NaN)) == :(f($NaN))
@test isequal(:(f($NaN)), :(f($NaN)))

0 comments on commit 40031f3

Please sign in to comment.