# `syntax.ternary_operator`

Value chosen with `? :`.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

A choice between two values is a `match` on the condition; the edit writes it.

```jadpo
type Count = Int {
    min: 0
}

type Size = Text {}

function size(count: Count) -> Size {
    return count > 10 ? "large" : "small"
}
```

```text
error: Jadpo chooses a value with `match`, not `? :`
 --> main.jadpo:8:23
  |
8 |     return count > 10 ? "large" : "small"
  |                       ^ write a `match`
  reason: `condition ? a : b` chooses a value in JavaScript, Java, C#, Kotlin and Swift; Jadpo chooses between two values with a `match` on the condition.
  next: Write `match (count > 10)` with the arms `true -> "large"` and `false -> "small"` (agent)
  rule: syntax.ternary_operator
  help: https://jadpo.dev/docs/errors/syntax.ternary_operator

check failed: 1 error, 1 file
```
