Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created January 13, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/0a4ca61523d3fb4aa9b5 to your computer and use it in GitHub Desktop.
Save jnthn/0a4ca61523d3fb4aa9b5 to your computer and use it in GitHub Desktop.
diff --git a/lib/NativeCall.pm6 b/lib/NativeCall.pm6
index b82be7b..bd4812e 100644
--- a/lib/NativeCall.pm6
+++ b/lib/NativeCall.pm6
@@ -339,9 +339,9 @@ role ExplicitlyManagedString {
has $.cstr is rw;
}
-multi explicitly-manage(Str $x, :$encoding = 'utf8') is export(:DEFAULT,
+multi explicitly-manage(Str $x is rw, :$encoding = 'utf8') is export(:DEFAULT,
:utils) {
- $x does ExplicitlyManagedString;
+ $x = $x but ExplicitlyManagedString;
my $class = class CStr is repr('CStr') { method encoding() { $encoding; } };
$x.cstr = nqp::box_s(nqp::unbox_s($x), nqp::decont($class));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment