From 6dad3dbea7cc4078b116672065e9555d79f0bf15 Mon Sep 17 00:00:00 2001 From: kagalenko-m-b Date: Mon, 9 Sep 2024 00:38:53 +0300 Subject: [PATCH] Make the type of the length-1 vector of functions to be Vector{Function} --- src/problem_compiler.jl | 2 +- test/runtests.jl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/problem_compiler.jl b/src/problem_compiler.jl index 8147e6f..d1faf22 100644 --- a/src/problem_compiler.jl +++ b/src/problem_compiler.jl @@ -17,7 +17,7 @@ macro problemset(set_name, set_body) end quote $(esc(set_body)) - $(esc(set_name)) = [$([:($(esc(prob))) for prob in prob_names]...)] + $(esc(set_name)) = $(esc(:Function))[$([:($(esc(prob))) for prob in prob_names]...)] end end diff --git a/test/runtests.jl b/test/runtests.jl index ee38d84..1522951 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -110,9 +110,10 @@ end pr_set = macroexpand( @__MODULE__, problem_set, recursive=:false); Base.remove_linenums!(pr_set) @test length(pr_set.args) == 2 - @test pr_set.args[2] == :(test_problem_set = [test_problem_set_sub_add, - test_problem_set_sub, - test_problem_set_add]) + @test pr_set.args[2] == :(test_problem_set = Function[ + test_problem_set_sub_add, + test_problem_set_sub, + test_problem_set_add]) end @testset "Problem selection" begin