Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Explicitely complain about lazy lists in (s)printf.
  • Loading branch information
peschwa committed Mar 16, 2016
1 parent e8bc151 commit ad19288
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -345,6 +345,14 @@ multi sub wordcase(Str:D $x) {$x.wordcase }
multi sub wordcase(Cool $x) {$x.Str.wordcase }

sub sprintf(Cool $format, *@args) {
CATCH {
when X::Cannot::Lazy {
X::Cannot::Lazy.new(:action('(s)printf')).throw
}
default {
$_.throw
}
}
Rakudo::Internals.initialize-sprintf-handler;
@args.elems;
nqp::p6box_s(
Expand Down

0 comments on commit ad19288

Please sign in to comment.