---
title: "CmpArg: type in Types, TypeShade API reference"
description: "CmpArg, a type in Types. The operand a comparison method accepts for a receiver of key K: the receiver's own scalar kind…"
url: https://typeshade.dev/api/cmparg/
language: en
---

# `CmpArg`

Type in Types

The operand a comparison method accepts for a receiver of key K: the receiver's own scalar kind, since both targets compare matching operands only, plus `f32` for an `f64` receiver, which widens before the compare.

`import type { CmpArg } from 'typeshade'`
`import type { CmpArg } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
type CmpArg<K extends string> = ReadonlyNode<KindScalar<K>> | number;
```

## Description

A mixed pair (`f32` against `i32`, `f64` against an integer) is a type error. A JS `number` lifts to the receiver’s scalar kind.

## Source

[`src/core/ir/node.ts`, line 67](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L67), at commit af54ddad5
