Skip to content
Permalink
Browse files

Change :$filename type constraint in EVAL from Str to Str()

  • Loading branch information...
pmurias committed Mar 7, 2019
1 parent 2732a28 commit 69d88be37544890d4ab7e9569d6e92b265339f9a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/ForeignCode.pm6
@@ -24,7 +24,7 @@ my class Rakudo::Internals::EvalIdSource {
$lock.protect: { $count++ }
}
}
proto sub EVAL($code is copy where Blob|Cool|Callable, Str() :$lang = 'perl6', PseudoStash :$context, Str :$filename, *%n) {
proto sub EVAL($code is copy where Blob|Cool|Callable, Str() :$lang = 'perl6', PseudoStash :$context, Str() :$filename, *%n) {
die "EVAL() in Perl 6 is intended to evaluate strings, did you mean 'try'?"
if nqp::istype($code,Callable);
# First look in compiler registry.
@@ -64,7 +64,7 @@ proto sub EVAL($code is copy where Blob|Cool|Callable, Str() :$lang = 'perl6', P
$compiled();
}

multi sub EVAL($code, Str :$lang where { ($lang // '') eq 'Perl5' }, PseudoStash :$context, Str :$filename) {
multi sub EVAL($code, Str :$lang where { ($lang // '') eq 'Perl5' }, PseudoStash :$context, Str() :$filename) {
my $eval_ctx := nqp::getattr(nqp::decont($context // CALLER::), PseudoStash, '$!ctx');
my $?FILES := $filename // 'EVAL_' ~ Rakudo::Internals::EvalIdSource.next-id;
state $p5;

0 comments on commit 69d88be

Please sign in to comment.
You can’t perform that action at this time.