Skip to content

Commit

Permalink
Relax type requirements on CompUnit::Loader's methods
Browse files Browse the repository at this point in the history
We don't need a mutable Buf. A Blob will do just fine.
Fixes CompUnit::Loader.load-source("1 + 1".encode)
  • Loading branch information
niner committed Jul 5, 2016
1 parent 8cb0fac commit 4188109
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/CompUnit/Loader.pm
Expand Up @@ -8,7 +8,7 @@ class CompUnit::Loader is repr('Uninstantiable') {
}

# Decode the specified byte buffer as source code, and compile it
method load-source(Buf:D $bytes) returns CompUnit::Handle {
method load-source(Blob:D $bytes) returns CompUnit::Handle {
my $preserve_global := nqp::ifnull(nqp::gethllsym('perl6', 'GLOBAL'), Mu);

my $*CTXSAVE := self;
Expand Down Expand Up @@ -51,7 +51,7 @@ class CompUnit::Loader is repr('Uninstantiable') {

# Load the specified byte buffer as if it was the contents of a
# precompiled file
method load-precompilation(Buf:D $bytes) returns CompUnit::Handle {
method load-precompilation(Blob:D $bytes) returns CompUnit::Handle {
my $*CTXSAVE := self;
my %*COMPILING := nqp::hash();
my Mu $*MAIN_CTX;
Expand Down

0 comments on commit 4188109

Please sign in to comment.