[Issue 22663] Module is not recognized inside an "if"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 17 11:49:26 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22663

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
You cannot use `number_conv.digit_count` because this symbol technically does
not exist in the compiler. You can either use `enums.number_conv.digit_count`
or the shorter`digit_count` directly. This is a mistake on your side, the
compiler is not doing anything wrong.

The fact that only one occurrence errors while the rest do not can be explained
by the fact that you are using compile time conditions. Basically, the other
branches do not exist for the compiler because the conditions are not met. You
will notice that the branch where the name fails is where the parameter is an
int; that is because 2737 is viewed as an int by the compiler. If you
instantiate the function with let's say a byte, then the error will be moved on
that branch.

As a conclusion, the compiler works as expected. You need to correctly use the
identifiers. Closing as invalid.

--


More information about the Digitalmars-d-bugs mailing list