Template param with default value `nil` and type `untyped` keeps the type `untyped`
### Description

```nim
proc foo(x: proc ()) = x()

template bar(x: untyped = nil) =
  foo(x)

bar()
```

### Nim Version

[6f6e34e](https://github.com/nim-lang/Nim/commit/6f6e34ebb037cdc83f8ec24b0422e70fc70d7107), 2.0

### Current Output

```text
Error: type mismatch: got <untyped>
but expected one of:
proc foo(x: proc ())
  first type mismatch at position: 1
  required type for x: proc (){.closure.}
  but expression 'nil' is of type: untyped

expression: foo(nil)
```


### Expected Output

```text
compiles
```


### Known Workarounds

_No response_

### Additional Information

_No response_