Change Log: 2.071.2
Download D 2.071.2 Beta
to be released August 7, 2016
List of all bug fixes and enhancements in D 2.071.2.
Language Changes
- The allMembers and derivedMembers traits now only return visible symbols.
Since changing the protection system from access to visibility checks (see DIP22), using the getMember traits would often result in spurious deprecation warnings for invisible (private) symbols in allMembers or derivedMembers. As the symbols weren't accessible before and are now invisible, the implementation of the traits was changed to no longer list those.
To ease updating existing code, the old behavior can be restored using the -transition=import compiler switch.
In case you want a template from a library to return private members, you can mixin the template into the instantiation scope. Note that it's possible to mixin normal templates even though they're not declared as mixin template.
Example:
import std.traits; enum UDA; struct S { @UDA int visible; @UDA private int invisible; } // only returns symbols visible from std.traits static assert(getSymbolsByUDA!(S, UDA).length == 1); // mixin the template instantiation, using a name to avoid namespace pollution mixin getSymbolsByUDA!(S, UDA) symbols; // as the template is instantiated in the current scope, it can see private members static assert(symbols.getSymbolsByUDA.length == 2);
See also Bugzilla 15907
List of all bug fixes and enhancements in D 2.071.2:
DMD Compiler regressions
- Bugzilla 15780: [REG2.069] CTFE foreach fails with tuple
- Bugzilla 15900: [REG 2.071] (Import deprecation) Public import ignored when using fully qualified name
- Bugzilla 15907: Unjustified "is not visible from module" deprecation warning when using getMember trait
- Bugzilla 16085: wrong visibility warning for overloaded alias symbol
- Bugzilla 16188: [REG2.069] ICE on invalid code
- Bugzilla 16225: [REG 2.068] Internal error cod1.c 1338 with -O
- Bugzilla 16316: [REG 2.071] (Import deprecation) fully qualified name of imports in mixin template not accessible
- Bugzilla 16348: [REG 2.070.2] ICE with package visibility