]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix arg count for signatures with optional args in -dbs output
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 8 Apr 2024 23:13:26 +0000 (16:13 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 8 Apr 2024 23:13:26 +0000 (16:13 -0700)
lib/Perl/Tidy/Formatter.pm

index 33896788c4cb88435f422dd449c1cc9d381a4d60..1159e2a6491cc61adc1e37ebef2f1d9bc3177887 100644 (file)
@@ -13433,6 +13433,11 @@ sub count_list_args {
             $arg_count++;
         }
 
+        # an '=' in a signature indicates an optional arg
+        elsif ( $type eq '=' ) {
+            return if ($is_signature);
+        }
+
         # check for a paren-less call
         elsif ( $is_kwU{$type} ) {