File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
pkl-core/src/main/java/org/pkl/core/ast/type Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2538,9 +2538,17 @@ public TypeNode initWriteSlotNode(int slot) {
25382538
25392539 @ ExplodeLoop
25402540 protected Object executeLazily (VirtualFrame frame , Object value ) {
2541- var customThisSlot =
2542- frame .getFrameDescriptor ().findOrAddAuxiliarySlot (CustomThisScope .FRAME_SLOT_ID );
2543-
2541+ int customThisSlot ;
2542+ var numberOfAuxiliarySlots = frame .getFrameDescriptor ().getNumberOfAuxiliarySlots ();
2543+ if (numberOfAuxiliarySlots == 0 ) {
2544+ CompilerDirectives .transferToInterpreterAndInvalidate ();
2545+ customThisSlot =
2546+ frame .getFrameDescriptor ().findOrAddAuxiliarySlot (CustomThisScope .FRAME_SLOT_ID );
2547+ } else {
2548+ // assertion: we only use auxiliary slots for custom `this`.
2549+ assert numberOfAuxiliarySlots == 1 ;
2550+ customThisSlot = 0 ;
2551+ }
25442552 var ret = childNode .executeLazily (frame , value );
25452553
25462554 var localContext = language .localContext .get ();
You can’t perform that action at this time.
0 commit comments