January 17, 2022 [Issue 22663] Module is not recognized inside an "if" | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22663 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |INVALID --- Comment #1 from RazvanN <razvan.nitu1305@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. -- |
Copyright © 1999-2021 by the D Language Foundation