Skip to content

Commit 69185aa

Browse files
committed
use function syntax, don't define method bodies explicitly
1 parent 29e029e commit 69185aa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/no_invalidations.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ end
5656
@testset "construction of old int type from new type" begin
5757
broken = (Int8, UInt8, UInt16, Int, UInt)
5858
@testset "T: $T" for T int_types
59-
@test test_expr((n -> :(Base.$T(::$n) = $T(0))), Integer) broken=(T broken)
59+
@test test_expr((n -> :(function Base.$T(::$n) end)), Integer) broken=(T broken)
6060
end
6161
end
6262
@testset "construction of new int type from old type" begin
6363
broken = ()
6464
@testset "T: $T" for T int_types
65-
@test test_expr((n -> :($n(::$T) = $n())), Integer) broken=(T broken)
65+
@test test_expr((n -> :(function $n(::$T) end)), Integer) broken=(T broken)
6666
end
6767
end
6868
@testset "arithmetic between old int types and new int type" begin
@@ -71,8 +71,8 @@ end
7171
@testset "T: $T" for T int_types
7272
@testset "op: $op" for op ops
7373
@test (
74-
test_expr((n -> :(Base.$op(::$n, m::$T) = m)), Integer) &&
75-
test_expr((n -> :(Base.$op(m::$T, ::$n) = m)), Integer)
74+
test_expr((n -> :(function Base.$op(::$n, ::$T) end)), Integer) &&
75+
test_expr((n -> :(function Base.$op(::$T, ::$n) end)), Integer)
7676
) broken=((T, op) broken)
7777
end
7878
end
@@ -81,14 +81,14 @@ end
8181
broken = (Bool, UInt8, Int)
8282
@testset "T: $T" for T int_types
8383
@test (
84-
test_expr((n -> :(Base.promote_rule(::Type{$T}, ::Type{$n}) = $T)), Integer) &&
85-
test_expr((n -> :(Base.promote_rule(::Type{$n}, ::Type{$T}) = $T)), Integer)
84+
test_expr((n -> :(function Base.promote_rule(::Type{$T}, ::Type{$n}) end)), Integer) &&
85+
test_expr((n -> :(function Base.promote_rule(::Type{$n}, ::Type{$T}) end)), Integer)
8686
) broken=(T broken)
8787
end
8888
end
8989
@testset "unary functions" begin
90-
@test test_expr((n -> :(Base.zero(::$n) = $n())), Integer) broken=true
91-
@test test_expr((n -> :(Base.one(::$n) = $n())), Integer) broken=true
90+
@test test_expr((n -> :(function Base.zero(::$n) end)), Integer) broken=true
91+
@test test_expr((n -> :(function Base.one(::$n) end)), Integer) broken=true
9292
end
9393
end
9494
end

0 commit comments

Comments
 (0)