Skip to content

Commit 53a70bf

Browse files
Stephan SahmStephan Sahm
authored andcommitted
cleanup and bugfixes
1 parent cf0f32d commit 53a70bf

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/Try.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ thrown.
1616
const Try{T} = Union{Const{<:Exception}, Identity{T}}
1717
Try(t) = Identity(t)
1818
Try(t::Exception) = Const(t)
19-
Try{T}(t::T) where T = Identity(t)
20-
Try{T}(other) where T = Const(other)
21-
2219

2320

2421
"""
@@ -33,7 +30,7 @@ end
3330

3431
# == controversy https://github.com/JuliaLang/julia/issues/4648
3532
function Base.:(==)(a::Thrown, b::Thrown)
36-
a.exception == b.exception && a.stack == b.stack
33+
a.exception == b.exception && a.stacktrace == b.stacktrace
3734
end
3835

3936
function Base.show(io::IO, x::Thrown)
@@ -96,10 +93,6 @@ Base.merge(es::MultipleExceptions, e::Exception) = MultipleExceptions(tuple(es.e
9693
Base.merge(e::Exception, fs::MultipleExceptions) = MultipleExceptions(tuple(e, fs.exceptions...))
9794
Base.merge(es1::MultipleExceptions, es2::MultipleExceptions) = MultipleExceptions(tuple(es1.exceptions..., es2.exceptions...))
9895

99-
# enable Try for conversion
100-
Base.convert(::Type{Try{T}}, x::Identity{S}) where {S, T} = Identity(Base.convert(T, x.value))
101-
promote_rule(::Type{Try{T}}, ::Type{Try{S}}) where {T, S<:T} = Try{T}
102-
10396

10497
# we use a macro instead of dispatching on Try(f::Function) as this interferes e.g. with mapn
10598
# (in mapn anonymous functions are passed through, which should not get executed automatically)

0 commit comments

Comments
 (0)