In order to fix this error I would need to re-cast $*ARGFILES as a IO::CatHandle, since it uses some attributes of that class. I'm trying this:
use IO::CatHandle::AutoLines; # -*- mode:perl6 -*-
use Test;
if $*ARGFILES === $*IN {
$*ARGFILES = IO::CatHandle.new( $*IN );
}
eval-lives-ok "$*ARGFILES does IO::CatHandle::AutoLines", "Can recast \$*ARGFILES";
But this yields the error:
# Error: Unsupported use of <STDIN>; in Perl 6 please use $*IN.lines (or add whitespace to suppress warning)
This is independent, I think, of the role I'm mixing, but I add it for context. Any idea of what else could be done?