You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No error is produced as long as the value argument is less than 0x8000_0000.
A workaround has been provided by @Araqin the forum.
Nim Version
Reproducible on the playground v2.0.2 and my desktop:
Nim Compiler Version 2.0.0 [MacOSX: arm64]
Compiled at 2023-08-01
Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release -d:nimUseLinenoise
Current Output
nim c -r "/hide/my/path/file.nim"
Hint: used config file '/opt/homebrew/Cellar/nim/2.0.0_1/nim/config/nim.cfg' [Conf]
Hint: used config file '/opt/homebrew/Cellar/nim/2.0.0_1/nim/config/config.nims' [Conf]
......................................................................
/hide/my/path/file.nim(5, 12) Error: undeclared identifier: 'BAR'
Expected Output
I expect to be able to use the constants `FOOValue` and `BARValue`.
Possible Solution
No response
Additional Information
I understand I must apply the 'u32 type annotation to satisfy the compiler and {.inject.} to gain access to the constants. However, it is the error message that seems misleading.
The text was updated successfully, but these errors were encountered:
…or (#23984)
fixes#8697, fixes#9620, fixes#23265
When matching a `template` with an `untyped` argument fails because of a
mismatching typed argument, `presentFailedCandidates` tries to sem every
single argument to show their types, but trying to type the `untyped`
argument can fail if it's supposed to use an injected symbol, so we get
an unrelated error message like "undeclared identifier".
Instead we use `tryExpr` as the comment suggests, setting the type to
`untyped` if it fails to compile. We could also maybe check if an
`untyped` argument is expected in its place and not try to compile the
expression if it is but this would require a bit of reorganizing the
code here and IMO it's better to have the information of what type it
would be if it can be typed.
(cherry picked from commit 34719ca)
Description
On a 64-bit platform, this code
produces the following error:
No error is produced as long as the value argument is less than
0x8000_0000
.A workaround has been provided by @Araq in the forum.
Nim Version
Reproducible on the playground v2.0.2 and my desktop:
Current Output
Expected Output
Possible Solution
No response
Additional Information
I understand I must apply the
'u32
type annotation to satisfy the compiler and{.inject.}
to gain access to the constants. However, it is the error message that seems misleading.The text was updated successfully, but these errors were encountered: