|
56 | 56 | @testset "construction of old int type from new type" begin |
57 | 57 | broken = (Int8, UInt8, UInt16, Int, UInt) |
58 | 58 | @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) |
60 | 60 | end |
61 | 61 | end |
62 | 62 | @testset "construction of new int type from old type" begin |
63 | 63 | broken = () |
64 | 64 | @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) |
66 | 66 | end |
67 | 67 | end |
68 | 68 | @testset "arithmetic between old int types and new int type" begin |
|
71 | 71 | @testset "T: $T" for T ∈ int_types |
72 | 72 | @testset "op: $op" for op ∈ ops |
73 | 73 | @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) |
76 | 76 | ) broken=((T, op) ∈ broken) |
77 | 77 | end |
78 | 78 | end |
|
81 | 81 | broken = (Bool, UInt8, Int) |
82 | 82 | @testset "T: $T" for T ∈ int_types |
83 | 83 | @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) |
86 | 86 | ) broken=(T ∈ broken) |
87 | 87 | end |
88 | 88 | end |
89 | 89 | @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 |
92 | 92 | end |
93 | 93 | end |
94 | 94 | end |
0 commit comments