# XO0207: method chain on the right of `??` starts at a literal

Reported by `xo vet`, not `xo check`. A method call binds tighter than `??` (core 15 precedence), so in `x ?? [].f()` the call `.f()` applies only to the default `[]`, not to the unwrapped `x`. That is rarely what was meant when the chain starts at a literal. If the chain should apply to both, parenthesize the coalesce: `(x ?? []).f()`. If it really is only for the default, bind the default to a name to make that clear.

## Example

```xo
fn names(xs: List[Str]?) -> List[Str] {
  xs ?? [].reverse()
}
```

## Fix

```xo
fn names(xs: List[Str]?) -> List[Str] {
  (xs ?? []).reverse()
}
```

Run `xo explain XO0207` for this text in a terminal, or see
[section 10.6 of the specification](../../spec/core/#106-diagnostic-codes).

