Class TypeNode.WriteFrameSlotTypeNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
org.pkl.core.ast.PklNode
org.pkl.core.ast.type.TypeNode
org.pkl.core.ast.type.TypeNode.WriteFrameSlotTypeNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Direct Known Subclasses:
TypeNode.AnyTypeNode, TypeNode.NonNullTypeAliasTypeNode, TypeNode.NullableTypeNode, TypeNode.TypeVariableNode, TypeNode.UnionTypeNode, TypeNode.UnknownTypeNode
Enclosing class:
TypeNode

public abstract static class TypeNode.WriteFrameSlotTypeNode extends TypeNode
Base class for types whose `executeAndSet` method assigns values to slots with a `WriteFrameSlotNode`.
  • Field Details

    • slot

      protected int slot
  • Constructor Details

    • WriteFrameSlotTypeNode

      protected WriteFrameSlotTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection)
  • Method Details

    • getFrameSlotKind

      public final com.oracle.truffle.api.frame.FrameSlotKind getFrameSlotKind()
      Specified by:
      getFrameSlotKind in class TypeNode
    • initWriteSlotNode

      public TypeNode initWriteSlotNode(int slot)
      Description copied from class: TypeNode
      Initializes this node's frame slot. Called if this node is a function/method parameter type. Kept separate from constructor so that TypeNode.TypeAliasTypeNode can initialize frame slot of its cloned child node.
      Specified by:
      initWriteSlotNode in class TypeNode
    • executeAndSet

      public final void executeAndSet(com.oracle.truffle.api.frame.VirtualFrame frame, Object value)
      Description copied from class: TypeNode
      Checks if `value` conforms to this type. If so, sets `slot` to `value`. Otherwise, throws a `VmTypeMismatchException`.
      Specified by:
      executeAndSet in class TypeNode