type mismatch with generic object constructor
### Nim Version

version-2-2 and devel

### Description

The constructor `FieldUnop[o,X](f1: x)` inside the template `fieldUnop` fails even though the type matches.
```nim
type
  Field = object
  FieldS = object
  FieldOps = enum
    foNeg, foAdd, foSub, foMul, foDiv, foAdj, foToSingle, foToDouble
  FieldUnop[Op: static FieldOps, T1] = object
    f1: T1
  FieldAddSub[S: static tuple, T: tuple] = object
    field: T
  SomeField = Field | FieldS | FieldUnop | FieldAddSub
  SomeField2 = Field | FieldS | FieldUnop | FieldAddSub

template fieldUnop[X:SomeField](o: static FieldOps, x: X): auto =
  FieldUnop[o,X](f1: x)
template fieldAddSub[X,Y](sx: static int, x: X, sy: static int, y: Y): auto =
  FieldAddSub[(a:sx,b:sy),tuple[a:X,b:Y]](field:(a:x,b:y))

template `:=`*(r: var FieldS, x: SomeField) =
  echo ":="
template toSingle(x: SomeField): auto =
  fieldUnop(foToSingle, x)
template toDouble(x: SomeField): auto =
  fieldUnop(foToDouble, x)
template `+`(x: SomeField, y: SomeField2): auto =
  fieldAddSub(1, x, 1, y)

var
  fd: Field
  fs,fs2: FieldS

fs2 := toSingle(fs.toDouble + fd)
```

### Current Output

```text
test.nim(31, 16) template/generic instantiation of `toSingle` from here
test.nim(14, 20) Error: type mismatch:
 got 'FieldAddSub[(a: 1, b: 1), tuple[a: FieldUnop[foToDouble, test.FieldS], b: Field]]' for 'FieldAddSub[(a: 1, b: 1), tuple[a: X, b: Y]](
    field: (a: FieldUnop[foToDouble, X](f1: fs), b: fd))' [object declared in test.nim(8, 3)]
 but expected 'FieldAddSub[(a: 1, b: 1), tuple[a: FieldUnop[foToDouble, test.FieldS], b: Field]]' [object declared in test.nim(8, 3)]
```

### Expected Output

```text
:=
```

### Known Workarounds

_No response_

### Additional Information

This example works with v2.2.2 and the full code worked with version-2-2 and devel on Feb 10, 2025.