File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
name = " ArgCheck"
2
2
uuid = " dce04be8-c92d-5529-be00-80e4d2c0e197"
3
3
license = " MIT"
4
- version = " 2.4.0 "
4
+ version = " 2.4.1 "
5
5
6
6
[compat ]
7
7
julia = " 1"
Original file line number Diff line number Diff line change 80
80
See also [`@check`](@ref).
81
81
"""
82
82
macro argcheck (ex, options... )
83
- check (ex, ArgCheckFlavor (), options... )
83
+ checkmacro (ex, ArgCheckFlavor (), options... )
84
84
end
85
85
86
86
"""
@@ -97,10 +97,13 @@ Usage is as follows:
97
97
See also [`@argcheck`](@ref).
98
98
"""
99
99
macro check (ex, options... )
100
- check (ex, CheckFlavor (), options... )
100
+ checkmacro (ex, CheckFlavor (), options... )
101
101
end
102
102
103
- function check (ex, checkflavor, options... )
103
+ function checkmacro (ex, checkflavor, options... )
104
+ if length (options) > 1
105
+ error (" Too many arguments for @check/@argcheck macro" )
106
+ end
104
107
codeflavor = if isexpr (ex, :comparison )
105
108
ComparisonFlavor ()
106
109
elseif isexpr (ex, :call )
Original file line number Diff line number Diff line change 308
308
@test Meta. isexpr (ArgCheck. LABEL_END_CHECK, :meta )
309
309
end
310
310
311
+ @testset " Informative error message at macro eval time for extra arguments #48" begin
312
+ # https://github.com/jw3126/ArgCheck.jl/issues/48
313
+ @test_throws " Too many arguments" @macroexpand ( @argcheck 1 == 1 1.8 " That's good" )
314
+ @test_throws " Too many arguments" @macroexpand ( @argcheck 1 == 2 1.8 " That's good" )
315
+ end
316
+
311
317
end # module
You can’t perform that action at this time.
0 commit comments