Default value of function's params doesn't work in functions

0 votes
asked Jun 17, 2019 in Bug by pmh (140 points)
This example works:

@startuml
!function $inner($param1, $param2 = "arg2")
!return $param1 + " " + $param2
!endfunction

!function $test($param)
!return $param
!endfunction

A -> B: $test($inner("arg1", "newarg2"))
@enduml

But if we will try to call $inner with one argument as param of $test function, there is an exception "Bad number of arguments in $inner". It means that default value inside functions doesn't work. Try this to see exception:

@startuml
!function $inner($param1, $param2 = "arg2")
!return $param1 + " " + $param2
!endfunction

!function $test($param)
!return $param
!endfunction

A -> B: $test($inner("arg1"))
@enduml

1 Answer

0 votes
answered Jun 17, 2019 by plantuml (295,000 points)
Thanks for the report.

This should be fixed with last beta http://beta.plantuml.net/plantuml.jar

Tell us if it's not working for you !
commented Jun 18, 2019 by pmh (140 points)

Thanks, this beta works smiley

...