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
The .subst/.subst-mutate methods slurp several of their options into a hash and then pass those
along to Str.match call. The logic that handles the result of that call, however, does not
pay attention to Failures. Specifically, failures resulting from incorrect values provided for
the named arguments that get passed to .match:
m: say 'foo'.subst: /\w/, '', :x{2}
rakudo-moar 222d16: OUTPUT«foo»
m: say 'foo'.subst: /\w/, '', :th(2.5)
rakudo-moar 222d16: OUTPUT«foo»
m: say ($ = 'foo').subst-mutate: /\w/, '', :th(2.5)
rakudo-moar 222d16: OUTPUT«Nil»
Thus, the user never receives any indication they're using the wrong arguments and the code behaves as the match simply fails.
On Tue Sep 27 11:39:00 2016, cpan@zoffix.com wrote:
# I have the fix; filing for records
The .subst/.subst-mutate methods slurp several of their options into a
hash and then pass those
along to Str.match call. The logic that handles the result of that
call, however, does not
pay attention to Failures. Specifically, failures resulting from
incorrect values provided for
the named arguments that get passed to .match:
m: say 'foo'.subst: /\w/, '', :x{2}
rakudo-moar 222d16: OUTPUT«foo»
m: say 'foo'.subst: /\w/, '', :th(2.5)
rakudo-moar 222d16: OUTPUT«foo»
m: say ($ = 'foo').subst-mutate: /\w/, '', :th(2.5)
rakudo-moar 222d16: OUTPUT«Nil»
Thus, the user never receives any indication they're using the wrong
arguments and the code behaves as the match simply fails.
Migrated from rt.perl.org#129374 (status was 'resolved')
Searchable as RT129374$
The text was updated successfully, but these errors were encountered: