`cannot instantiate T`, even when matching overload that doesn't require T exists
### Description

```nim
type
  R[T, E] = object
  A = object
  B = object

# Remove this overload to make it work
func err[T](_: type R[T, void]): R[T, void] = discard

func err(_: type R): R[A, B] = discard

echo R.err()
```


### Nim Version

2.0, 2.2

### Current Output

```text
testit.nim(11, 7) template/generic instantiation of `err` from here
testit.nim(6, 10) Error: cannot instantiate: 'T'
```

### Expected Output

```text

```

### Known Workarounds

_No response_

### Additional Information

_No response_