Skip to content

Commit 089631d

Browse files
committed
fix 1.0 ambiguity and Int32 error
1 parent 1ae20c3 commit 089631d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/projection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function ProjectTo(x::Ref)
265265
return ProjectTo{Ref}(; type=typeof(x), x=sub)
266266
end
267267
end
268-
(project::ProjectTo{Ref})(dx::Tangent) = Tangent{project.type}(; x=project.x(dx.x))
268+
(project::ProjectTo{Ref})(dx::Tangent{<:Ref}) = Tangent{project.type}(; x=project.x(dx.x))
269269
(project::ProjectTo{Ref})(dx::Ref) = Tangent{project.type}(; x=project.x(dx[]))
270270
# Since this works like a zero-array in broadcasting, it should also accept a number:
271271
(project::ProjectTo{Ref})(dx::Number) = Tangent{project.type}(; x=project.x(dx))

test/differentials/abstract_zero.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
@test ComplexF64(1.5, z) === Complex{Float64}(1.5, 0.0)
7171

7272
@test convert(Bool, ZeroTangent()) === false
73-
@test convert(Int64, ZeroTangent()) === 0
73+
@test convert(Int64, ZeroTangent()) === Int64(0)
7474
@test convert(Float32, ZeroTangent()) === 0.0f0
7575
@test convert(ComplexF64, ZeroTangent()) === 0.0 + 0.0im
7676
end

0 commit comments

Comments
 (0)