Skip to content

Commit d6dc8a9

Browse files
committed
deprecate TArray and TRef.
1 parent 9579c93 commit d6dc8a9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/tarray.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ Array(ta) # convert to 4-element Array{Int64,1}: [1, 2, 3, 4]
2727
"""
2828
mutable struct TArray{T, N, A <: AbstractArray{T, N}} <: AbstractArray{T, N}
2929
data::A
30+
31+
function TArray(data::A) where {T, N, A <: AbstractArray{T, N}}
32+
Base.depwarn("`TArray` is deprecated, please overload `tape_copy` for `Array` and use `Array` instead.", :TArray)
33+
new{T, N, A}(data)
34+
end
3035
end
3136

3237
TArray{T}(d::Integer...) where T = TArray(T, d)

src/tref.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ d["A"] = 10
3636
"""
3737
mutable struct TRef{T}
3838
val::T
39+
40+
function TRef(val::T) where {T}
41+
Base.depwarn("`TRef` is deprecated, please overload `tape_copy` for `Ref` and use `Ref` instead.", :TRef)
42+
new{T}(val)
43+
end
3944
end
4045

4146
Base.get(r::TRef) = r.val

0 commit comments

Comments
 (0)