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
Identifiers starting with `__` are reserved for compiler and their behaviour is implementation-defined. But compilers do not show warning or error message when you try to use such names. Furthermore, some functions ignore these identifiers and may produce hidden bugs in a code. For example:
void main()
{
writeln([__traits(allMembers, S)]); // will print only ["a"]
}
struct S
{
int a;
int __refCount;
}
Documentation of `allMembers` says nothing about this behaviour.
Links:
https://dlang.org/spec/lex.html#identifiershttps://dlang.org/spec/traits.html#allMembershttps://github.com/dlang/dmd/blob/2ce74fc1180a3b0ed5e5c29aa79bf3773af5d5b7/src/dmd/traits.d#L1385https://forum.dlang.org/thread/yauflbmphapnnksckksu@forum.dlang.org
The text was updated successfully, but these errors were encountered:
schveiguy (@schveiguy) commented on 2018-06-26T14:35:39Z
My suggestion is to only emit warnings for packages that are not owned by the language. In other words, the language should be free to add these types of symbols in std.*, rt.*, core.*, and object without complaint.
dayllenger reported this on 2018-06-26T08:31:41Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19028
CC List
Description
The text was updated successfully, but these errors were encountered: