Skip to content

Commit 0c26f68

Browse files
committed
follow delegates in getNativeCallBody
1 parent c16481c commit 0c26f68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vm/jvm/runtime/org/perl6/nqp/runtime/NativeCallOps.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.perl6.nqp.sixmodel.reprs.NativeCallBody;
4747
import org.perl6.nqp.sixmodel.reprs.NativeRefInstance;
4848
import org.perl6.nqp.sixmodel.reprs.Refreshable;
49+
import org.perl6.nqp.sixmodel.reprs.P6OpaqueBaseInstance;
4950

5051
public final class NativeCallOps {
5152
public static long init() {
@@ -323,6 +324,10 @@ private static NativeCallBody getNativeCallBody(ThreadContext tc, SixModelObject
323324
call = ((NativeCallInstance)target).body;
324325
}
325326
else {
327+
/* Handle mixins by following delegates. */
328+
if (target instanceof P6OpaqueBaseInstance
329+
&& ((P6OpaqueBaseInstance)target).delegate != null)
330+
target = ((P6OpaqueBaseInstance)target).delegate;
326331
call = (NativeCallBody)target.get_boxing_of(tc, ncrepr.ID);
327332
if (call == null) {
328333
call = new NativeCallBody();

0 commit comments

Comments
 (0)