Quirk with undeclared identifiers passed as arguments and function/template call matching
```nim
template foo(a) = discard
block:
  proc foo(i: int) = discard # <<---
  foo(bar) # `bar` doesn't exist
```
`Error: undeclared identifier: 'bar'`
```nim
template foo(a) = discard
block:
  # proc foo(i: int) = discard # <<---
  foo(bar)
```
No issue

***
```bash
>nim -v
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-06-27
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 828cd58d8a0376a5b7a6ad58d73d66617b37629a
active boot switches: -d:release
```