Regression with distinct typeclass and or type in default params
### Description

Original example used `repr` instead of `foo`, which has a `distinct` typeclass overload.

```nim
type
  Foo = distinct int
  Bar = distinct int
  FooBar = Foo | Bar

proc foo[T: distinct](x: T): string = "a"
proc foo(x: Foo): string = "b"
proc foo(x: Bar): string = "c"

proc bar(x: FooBar, y = foo(x)) = discard
```

### Nim Version

presumably anything after #24065

### Current Output

```text
a.nim(10, 28) template/generic instantiation of `foo` from here
a.nim(6, 10) Error: cannot instantiate: 'T'
```


### Expected Output

```text
compiles
```


### Known Workarounds

_No response_

### Additional Information

_No response_