Skip to content

Inconsistent definition of value nodes #1461

@Cito

Description

@Cito

I noticed that "value nodes" are defined differently in language/ast and language/predicates:

export type ValueNode =
  | VariableNode  // <-- missing in isValueNode
  | IntValueNode
  | FloatValueNode
  | StringValueNode
  | BooleanValueNode
  | NullValueNode
  | EnumValueNode
  | ListValueNode
  | ObjectValueNode;
export function isValueNode(node: ASTNode): boolean %checks {
  return (
    node.kind === Kind.INT ||
    node.kind === Kind.FLOAT ||
    node.kind === Kind.STRING ||
    node.kind === Kind.BOOLEAN ||
    node.kind === Kind.NULL ||
    node.kind === Kind.ENUM ||
    node.kind === Kind.LIST ||
    node.kind === Kind.OBJECT ||
    node.kind === Kind.OBJECT_FIELD   // <-- missing in ValueNode
  );
}

Shouldn't these two definitions be consistent with each other?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions