You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding the following derived function on MyQueryGroup to test/Salsa.jl
# Verify that derived functions can take default parameters.
Salsa.@derivedfunctiondefault_source(db::MyQueryGroup, name::String="stdlib")
return db.source_text[name]
end
and including the following testset
@testset"Default parameters in derived functions"begin
db =MyQueryGroup()
db.source_text["stdlib"] ="..."@testdefault_source(db) ==default_source(db, "stdlib")
end
fails with
Default parameters in derived functions: Error During Test at /Users/niko/Projects/raicode/packages/Salsa/test/Salsa.jl:279
Test threw exception
Expression: default_source(db) == default_source(db, "stdlib")
MethodError: no method matching default_source(::Main.SalsaTest.MyQueryGroup)
Closest candidates are:
default_source(::Main.SalsaTest.MyQueryGroup, !Matched::String) at /Users/niko/Projects/raicode/packages/Salsa/src/Salsa.jl:481
Stacktrace:
[1] top-level scope at /Users/niko/Projects/raicode/packages/Salsa/test/Salsa.jl:279
[2] top-level scope at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Test/src/Test.jl:1113
[3] top-level scope at /Users/niko/Projects/raicode/packages/Salsa/test/Salsa.jl:277
Would it be possible to support default parameters on derived functions? Or is there a conceptual reason not to do so?
Thanks!
The text was updated successfully, but these errors were encountered:
Adding the following derived function on
MyQueryGroup
totest/Salsa.jl
and including the following testset
fails with
Would it be possible to support default parameters on derived functions? Or is there a conceptual reason not to do so?
Thanks!
The text was updated successfully, but these errors were encountered: