Skip to content

Commit

Permalink
Give P6opaque box target handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jan 7, 2013
1 parent 6b81e0e commit f353a12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/org/perl6/nqp/sixmodel/REPR.java
Expand Up @@ -112,5 +112,8 @@ public Instruction[] inlineBind(ThreadContext tc, STable st, ClassGen c, Constan
public Instruction[] inlineGet(ThreadContext tc, STable st, ClassGen c, ConstantPoolGen cp, String prefix) {
throw new RuntimeException("This representation cannot inline itself into another");
}
public void generateBoxingMethods(ThreadContext tc, STable st, ClassGen c, ConstantPoolGen cp, String prefix) {
throw new RuntimeException("This representation does not support being a box target");
}
}

4 changes: 3 additions & 1 deletion src/org/perl6/nqp/sixmodel/reprs/P6Opaque.java
Expand Up @@ -219,7 +219,9 @@ public void compose(ThreadContext tc, STable st, SixModelObject repr_info) {
* methods.
*/
if (box_target) {
throw new RuntimeException("P6opaque box/unbox NYI");
if (ss.inlineable == StorageSpec.REFERENCE)
throw new RuntimeException("A box_target must not have a reference type attribute");
type.st.REPR.generateBoxingMethods(tc, type.st, c, cp, "field_" + i);
}
}

Expand Down

0 comments on commit f353a12

Please sign in to comment.