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
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Enclosing class:
- TypeNode
-
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.WriteFrameSlotTypeNodeNested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Field Summary
Fields inherited from class org.pkl.core.ast.PklNode
sourceSection -
Constructor Summary
ConstructorsConstructorDescriptionConstrainedTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection, TypeNode childNode, TypeConstraintNode[] constraintNodes) -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, String qualifiedName) protected PTypedoExport()voidChecks if `value` conforms to this type.voidexecuteAndSet(com.oracle.truffle.api.frame.VirtualFrame frame, Object value) Checks if `value` conforms to this type.com.oracle.truffle.api.source.SourceSectioncom.oracle.truffle.api.source.SourceSectioncom.oracle.truffle.api.frame.FrameSlotKindinitWriteSlotNode(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, typeMismatchMethods inherited from class org.pkl.core.ast.PklNode
exceptionBuilder, getShortName, getSourceSection, toStringMethods 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 Details
-
ConstrainedTypeNode
public ConstrainedTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection, TypeNode childNode, TypeConstraintNode[] constraintNodes)
-
-
Method Details
-
getFrameSlotKind
public com.oracle.truffle.api.frame.FrameSlotKind getFrameSlotKind()- Specified by:
getFrameSlotKindin classTypeNode
-
initWriteSlotNode
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
Description copied from class:TypeNodeChecks if `value` conforms to this type. If so, returns normally. Otherwise, throws a `VmTypeMismatchException`. -
executeAndSet
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
@Nullable public @Nullable Object createDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, String qualifiedName) - Overrides:
createDefaultValuein classTypeNode
-
getBaseTypeSection
public com.oracle.truffle.api.source.SourceSection getBaseTypeSection() -
getFirstConstraintSection
public com.oracle.truffle.api.source.SourceSection getFirstConstraintSection() -
doExport
-
getMirror
-