Error: type mismatch: got 'proc ()' for 'handleOOM' but expected 'proc (){.nimcall, gcsafe.}'
### Nim Version

Nim Compiler Version 2.2.2 [Windows: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf

active boot switches: -d:release

### Description

According to [the nim 2.2.2 stdlib system website](https://nim-lang.org/docs/system.html#outOfMemHook) example, it can't be compiled. If adding the pragmas `{.nimcall, gcsafe.}` then re-compiling it, the `Error: 'handleOOM' is not GC-safe as it accesses 'gOutOfMem' which is a global using GC'ed memory` was thrown.
```nim
var gOutOfMem: ref OutOfMemDefect #EOutOfMemory
new(gOutOfMem) # need to be allocated *before* OOM really happened!
gOutOfMem.msg = "out of memory"

proc handleOOM() =
  raise gOutOfMem

system.outOfMemHook = handleOOM
```

### Current Output

```text
>nim c -d:release oomhook
Hint: used config file '..\.choosenim\toolchains\nim-2.2.2\config\nim.cfg' [Conf]
Hint: used config file '..\.choosenim\toolchains\nim-2.2.2\config\config.nims' [Conf]
.......................................................................
..\oomhook.nim(8, 23) Error: type mismatch: got 'proc ()' for 'handleOOM' but expected 'proc (){.nimcall, gcsafe.}'
  Pragma mismatch: got '{..}', but expected '{.gcsafe.}'.
```

### Expected Output

```text
Compiling passes.
```

### Known Workarounds

_No response_

### Additional Information

_No response_