Skip to content

Commit 4098710

Browse files
committed
Fix wrong deprecation message. Fixes #88
1 parent dd301de commit 4098710

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Parameters.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ function with_kw(typedef, mod::Module, withshow=true)
558558
esc($Parameters.$(_pack)(ex, $unpack_vars))
559559
end
560560
macro $pack_name_depr(ex)
561-
Base.depwarn("The macro `@$($(Meta.quot(pack_name)))` is deprecated, use `@$($(Meta.quot(pack_name_depr)))`", $(QuoteNode(pack_name_depr)) )
561+
Base.depwarn("The macro `@$($(Meta.quot(pack_name_depr)))` is deprecated, use `@$($(Meta.quot(pack_name)))`", $(QuoteNode(pack_name_depr)) )
562562
esc($Parameters.$(_pack)(ex, $unpack_vars))
563563
end
564564
$tn

test/runtests.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Parameters, Test, Markdown
1+
using Parameters, Test, Markdown, REPL
22

33
# misc
44
a8679 = @eval (a=1, b=2)
@@ -34,7 +34,6 @@ end
3434
@test "Test documentation\n" == Markdown.plain(@doc MT1)
3535
# https://github.com/JuliaLang/julia/issues/27092 means this does not work:
3636
# @test "A field Default: sdaf\n" == Markdown.plain(@doc MT1.c)
37-
using REPL
3837
@test "Field r Default: 4\n" == Markdown.plain(REPL.fielddoc(MT1, :r))
3938
@test "A field Default: sdaf\n" == Markdown.plain(REPL.fielddoc(MT1, :c))
4039

@@ -138,8 +137,8 @@ abstract type AMT{R<:Real} end
138137
r::R=5
139138
a::I
140139
end
141-
@test_throws MethodError MT5(r=4, a=5.) # need to specify type parameters
142-
MT5{Float32, Int}(r=4, a=5.)
140+
@test_throws MethodError MT5(r=4, a=5.) # a has wrong type
141+
MT5{Float32, Int}(r=4, a=5.) # a gets converted
143142
MT5{Float32, Int}(a=5.)
144143
MT5{Float32, Int}(5.4, 4) # inner positional
145144
mt5=MT5(5.4, 4) # outer positional
@@ -367,10 +366,7 @@ end
367366
@test_throws MethodError I10(a=10) # typeof(a)!=typeof(c)
368367
a_ = I10(a="asd")
369368
b_ = I10{String}("asd",10,"aaa")
370-
for fn in fieldnames(typeof(a_))
371-
# complicated testing because of mutable T
372-
@test getfield(a_, fn)==getfield(b_, fn)
373-
end
369+
@test a_==b_
374370

375371
@with_kw struct I10a{T}
376372
a::T

0 commit comments

Comments
 (0)