Skip to content

Commit

Permalink
extra_arg: fix compatibility with different julia versions
Browse files Browse the repository at this point in the history
  • Loading branch information
melven authored and barche committed Jan 16, 2024
1 parent 100831a commit 1799fa7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CxxWrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ function build_function_expression(func::CppFunctionInfo, funcidx, julia_mod)
# Build an array of arg1::Type1... expressions
function argmap(signature)
result = Expr[]
for (t, s, i) in zip(signature, argsymbols, range(1,length(signature)))
for (t, s, i) in zip(signature, argsymbols, 1:length(signature))
argt = map_julia_arg_type_named(func.name, t)
if isassigned(arg_default_values, i)
# somewhat strange syntax to define default argument argument...
Expand Down
2 changes: 1 addition & 1 deletion test/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end

# Test functions from the CppTestFunctions module
@test CppTestFunctions.concatenate_numbers(4, 2.) == "42"
@test methods(CppTestFunctions.concatenate_numbers_with_named_args)[1].slot_syms == "#self#\0i\0d\0val\0"
@test startswith(methods(CppTestFunctions.concatenate_numbers_with_named_args)[1].slot_syms, "#self#\0i\0d\0")
@test CppTestFunctions.concatenate_numbers_with_kwargs(d=2., i=4) == "42"
@test CppTestFunctions.concatenate_numbers_with_default_values(3) == "35.2"
@test CppTestFunctions.concatenate_numbers_with_default_values_of_different_type(3) == "35"
Expand Down

0 comments on commit 1799fa7

Please sign in to comment.