Skip to content

Commit e40c501

Browse files
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ade4b59 commit e40c501

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/tangent_types/tangent.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct Tangent{P,T} <: AbstractTangent
2929
function Tangent{P,T}(backing) where {P,T}
3030
function backing_error(P, G, E)
3131
msg = "Tangent for the primal $P should be backed by a $E type, not by $G."
32-
throw(ArgumentError(msg))
32+
return throw(ArgumentError(msg))
3333
end
3434

3535
if P <: Tuple

test/tangent_types/tangent.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ end
2525

2626
@testset "constructor" begin
2727
t = (1.0, 2.0)
28-
nt = (x = 1, y=2.0)
28+
nt = (x=1, y=2.0)
2929
d = Dict(:x => 1.0, :y => 2.0)
3030
vals = [1, 2]
3131

32-
@test_throws ArgumentError Tangent{typeof(t), typeof(nt)}(nt)
33-
@test_throws ArgumentError Tangent{typeof(t), typeof(d)}(d)
32+
@test_throws ArgumentError Tangent{typeof(t),typeof(nt)}(nt)
33+
@test_throws ArgumentError Tangent{typeof(t),typeof(d)}(d)
3434

35-
@test_throws ArgumentError Tangent{typeof(d), typeof(nt)}(nt)
36-
@test_throws ArgumentError Tangent{typeof(d), typeof(t)}(t)
35+
@test_throws ArgumentError Tangent{typeof(d),typeof(nt)}(nt)
36+
@test_throws ArgumentError Tangent{typeof(d),typeof(t)}(t)
3737

38-
@test_throws ArgumentError Tangent{typeof(nt), typeof(vals)}(vals)
39-
@test_throws ArgumentError Tangent{typeof(nt), typeof(d)}(d)
40-
@test_throws ArgumentError Tangent{typeof(nt), typeof(t)}(t)
38+
@test_throws ArgumentError Tangent{typeof(nt),typeof(vals)}(vals)
39+
@test_throws ArgumentError Tangent{typeof(nt),typeof(d)}(d)
40+
@test_throws ArgumentError Tangent{typeof(nt),typeof(t)}(t)
4141

42-
@test_throws ArgumentError Tangent{Foo, typeof(d)}(d)
43-
@test_throws ArgumentError Tangent{Foo, typeof(t)}(t)
42+
@test_throws ArgumentError Tangent{Foo,typeof(d)}(d)
43+
@test_throws ArgumentError Tangent{Foo,typeof(t)}(t)
4444
end
4545

4646
@testset "==" begin

0 commit comments

Comments
 (0)