Generic `define` pragma error about unsupported type is displayed only when it is redefined and used
### Description

Consider the following code:

```nim
type Foo = object
const foo {.define.} = Foo()
echo repr(foo)
```

If we just compile it with `nim c -r foo.nim`, it will print `Foo()` without any error. But if we redefine `foo` with `nim c -r -d:foo foo.nim`, we get an error:

```
Error: unsupported type foo for define 'Foo'
```

I think the compiler should generate this error in any case. Also, the error will not occur if the variable is not used, even if you redefine it.

Also, it seems that the variable name and its type are mixed up in the error message.


### Nim Version

Nim Compiler Version 2.2.0 [Windows: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf

active boot switches: -d:release

### Current Output

```text
No error
```


### Expected Output

```text
Error: unsupported type 'Foo' for define foo
```


### Known Workarounds

_No response_

### Additional Information

_No response_