Skip to content

Commit

Permalink
Improve comments, add final modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
odenix committed Dec 1, 2024
1 parent 6673a09 commit 8f65b68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.pkl.core.runtime.VmUtils;
import org.pkl.core.util.Nullable;

/** Equivalent of {@link TypedPropertyNode} for elements/entries. */
public abstract class ElementOrEntryNode extends RegularMemberNode {
@Child @Executed protected ExpressionNode receiverNode = new GetReceiverNode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.pkl.core.util.Nullable;

/** Performs a typecast on a Mapping entry value, or a Listing element. */
public class ListingOrMappingTypeCastNode extends PklRootNode {
public final class ListingOrMappingTypeCastNode extends PklRootNode {

@Child private TypeNode typeNode;
private final String qualifiedName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public final Object doTypeCast(
}

/**
* Tells whether the reified element/value type of this listing/mapping is known to be a subtype
* of {@code typeNode}. (If {@code true}, it is redundant to check that elements/values have type
* {@code typeNode}.)
* Tells whether the value type of this listing/mapping is known to be a subtype of {@code
* typeNode}. If {@code true}, type checks of individual values can be elided because
* listings/mappings are covariant in their value type.
*/
public final boolean valueTypeIsSubtypeOf(TypeNode typeNode) {
if (typeNode.isNoopTypeCheck()) {
Expand Down

0 comments on commit 8f65b68

Please sign in to comment.