• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37762

28 Apr 2024 07:31AM UTC coverage: 86.373% (-1.1%) from 87.431%
#37762

push

local

web-flow
infer_effects: add `optimize::Bool` optional argument (#54241)

`optimize=false` would be useful for testing effects refinements with
post-optimization analysis.

1 of 1 new or added line in 1 file covered. (100.0%)

947 existing lines in 40 files now uncovered.

75087 of 86933 relevant lines covered (86.37%)

14939860.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.77
/stdlib/Dates/src/deprecated.jl
1
# This file is a part of Julia. License is MIT: https://julialang.org/license
2

3
using Base: @deprecate, depwarn
4

5
# 1.0 deprecations
UNCOV
6
function (+)(x::AbstractArray{<:TimeType}, y::GeneralPeriod)
×
7
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
UNCOV
8
    x .+ y
×
9
end
10
function (+)(x::StridedArray{<:GeneralPeriod}, y::TimeType)
×
11
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
12
    x .+ y
×
13
end
UNCOV
14
function (+)(y::GeneralPeriod, x::AbstractArray{<:TimeType})
×
15
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
UNCOV
16
    x .+ y
×
17
end
18
function (+)(y::TimeType, x::StridedArray{<:GeneralPeriod})
×
19
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
20
    x .+ y
×
21
end
UNCOV
22
function (-)(x::AbstractArray{<:TimeType}, y::GeneralPeriod)
×
23
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
UNCOV
24
    x .- y
×
25
end
26
function (-)(x::StridedArray{<:GeneralPeriod}, y::TimeType)
×
27
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
28
    x .- y
×
29
end
30

31
# TimeType, AbstractArray{TimeType}
UNCOV
32
function (-)(x::AbstractArray{T}, y::T) where {T<:TimeType}
×
33
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
UNCOV
34
    x .- y
×
35
end
UNCOV
36
function (-)(y::T, x::AbstractArray{T}) where {T<:TimeType}
×
37
    # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
UNCOV
38
    y .- x
×
39
end
40

41
for (op, Ty, Tz) in ((:*, Real, :P),
42
                   (:/, :P, Float64), (:/, Real, :P))
43
    @eval begin
44
        function ($op)(X::StridedArray{P}, y::$Ty) where P<:Period
4✔
45
            # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
46
            Z = similar(X, $Tz)
8✔
47
            for (Idst, Isrc) in zip(eachindex(Z), eachindex(X))
8✔
48
                @inbounds Z[Idst] = ($op)(X[Isrc], y)
18✔
49
            end
32✔
50
            return Z
4✔
51
        end
52
    end
53
end
54

55
function (+)(x::StridedArray{<:GeneralPeriod})
×
56
    # depwarn("non-broadcasted operations are deprecated for Dates.TimeType; use broadcasting instead", nothing)
57
    x
×
58
end
59

60
for op in (:+, :-)
61
    @eval begin
62
        function ($op)(X::StridedArray{<:GeneralPeriod}, Y::StridedArray{<:GeneralPeriod})
6✔
63
            # depwarn("non-broadcasted arithmetic is deprecated for Dates.TimeType; use broadcasting instead", nothing)
64
            reshape(CompoundPeriod[($op)(x, y) for (x, y) in zip(X, Y)], promote_shape(size(X), size(Y)))
6✔
65
        end
66
    end
67
end
68

69
@deprecate argerror(msg::String) ArgumentError(msg) false
70
@deprecate argerror() nothing false
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc