Package org.pkl.core.ast.type
Class TypeNode.ConstrainedTypeNode
- 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.ConstrainedTypeNode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pkl.core.ast.type.TypeNode
TypeNode.AnyTypeNode, TypeNode.BooleanTypeNode, TypeNode.CollectionTypeNode, TypeNode.ConstrainedTypeNode, TypeNode.DynamicTypeNode, TypeNode.FinalClassTypeNode, TypeNode.FinalModuleTypeNode, TypeNode.FloatTypeNode, TypeNode.FrameSlotTypeNode, TypeNode.FunctionClassTypeNode, TypeNode.FunctionNClassTypeNode, TypeNode.FunctionTypeNode, TypeNode.Int16TypeAliasTypeNode, TypeNode.Int32TypeAliasTypeNode, TypeNode.Int8TypeAliasTypeNode, TypeNode.IntSlotTypeNode, TypeNode.IntTypeNode, TypeNode.ListingOrMappingTypeNode, TypeNode.ListingTypeNode, TypeNode.ListTypeNode, TypeNode.MappingTypeNode, TypeNode.MapTypeNode, TypeNode.NonFinalClassTypeNode, TypeNode.NonFinalModuleTypeNode, TypeNode.NonNullTypeAliasTypeNode, TypeNode.NothingTypeNode, TypeNode.NullableTypeNode, TypeNode.NumberTypeNode, TypeNode.ObjectSlotTypeNode, TypeNode.PairTypeNode, TypeNode.SetTypeNode, TypeNode.StringLiteralTypeNode, TypeNode.StringTypeNode, TypeNode.TypeAliasTypeNode, TypeNode.TypedTypeNode, TypeNode.TypeVariableNode, TypeNode.UIntTypeAliasTypeNode, TypeNode.UnionOfStringLiteralsTypeNode, TypeNode.UnionTypeNode, TypeNode.UnknownTypeNode, TypeNode.VarArgsTypeNode, TypeNode.WriteFrameSlotTypeNode
-
-
Field Summary
-
Fields inherited from class org.pkl.core.ast.PklNode
sourceSection
-
-
Constructor Summary
Constructors Constructor Description ConstrainedTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection, TypeNode childNode, TypeConstraintNode[] constraintNodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.ObjectcreateDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, java.lang.String qualifiedName)protected PTypedoExport()voidexecute(com.oracle.truffle.api.frame.VirtualFrame frame, java.lang.Object value)Checks if `value` conforms to this type.voidexecuteAndSet(com.oracle.truffle.api.frame.VirtualFrame frame, java.lang.Object value)Checks if `value` conforms to this type.com.oracle.truffle.api.source.SourceSectiongetBaseTypeSection()com.oracle.truffle.api.source.SourceSectiongetFirstConstraintSection()com.oracle.truffle.api.frame.FrameSlotKindgetFrameSlotKind()VmTypedgetMirror()TypeNodeinitWriteSlotNode(int slot)Initializes this node's frame slot.-
Methods inherited from class org.pkl.core.ast.type.TypeNode
export, forClass, getMirror, getMirrors, getTypeArgumentMirrors, getVmClass, getVmTypeAlias, isNoopTypeCheck, typeMismatch
-
Methods inherited from class org.pkl.core.ast.PklNode
exceptionBuilder, getShortName, getSourceSection, toString
-
Methods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize
-
-
-
-
Constructor Detail
-
ConstrainedTypeNode
public ConstrainedTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection, TypeNode childNode, TypeConstraintNode[] constraintNodes)
-
-
Method Detail
-
getFrameSlotKind
public com.oracle.truffle.api.frame.FrameSlotKind getFrameSlotKind()
- Specified by:
getFrameSlotKindin classTypeNode
-
initWriteSlotNode
public TypeNode initWriteSlotNode(int slot)
Description copied from class:TypeNodeInitializes this node's frame slot. Called if this node is a function/method parameter type. Kept separate from constructor so thatTypeNode.TypeAliasTypeNodecan initialize frame slot of its cloned child node.- Specified by:
initWriteSlotNodein classTypeNode
-
execute
public void execute(com.oracle.truffle.api.frame.VirtualFrame frame, java.lang.Object value)Description copied from class:TypeNodeChecks if `value` conforms to this type. If so, returns normally. Otherwise, throws a `VmTypeMismatchException`.
-
executeAndSet
public void executeAndSet(com.oracle.truffle.api.frame.VirtualFrame frame, java.lang.Object value)Description copied from class:TypeNodeChecks if `value` conforms to this type. If so, sets `slot` to `value`. Otherwise, throws a `VmTypeMismatchException`.- Specified by:
executeAndSetin classTypeNode
-
createDefaultValue
public @Nullable java.lang.Object createDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, java.lang.String qualifiedName)
- Overrides:
createDefaultValuein classTypeNode
-
getBaseTypeSection
public com.oracle.truffle.api.source.SourceSection getBaseTypeSection()
-
getFirstConstraintSection
public com.oracle.truffle.api.source.SourceSection getFirstConstraintSection()
-
-