Skip to content

Commit

Permalink
Merge pull request #1458 from MartinNowak/merge_stable
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/stable' into merge_stable
  • Loading branch information
MartinNowak committed Aug 30, 2016
2 parents 96b3b19 + 35a823c commit d053219
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
55 changes: 54 additions & 1 deletion changelog/2.071.2_pre.dd
Expand Up @@ -4,13 +4,66 @@ $(CHANGELOG_NAV_LAST 2.071.1)

$(VERSION August 7, 2016, =================================================,

$(BR)$(BIG List of all bug fixes and enhancements in D $(VER):)
$(BUGSTITLE Language Changes,
$(LI $(RELATIVE_LINK2 traits-members-visibility, The `allMembers` and `derivedMembers` traits now only return visible symbols.))
)

$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))

$(HR)

$(BUGSTITLE Language Changes,
$(LI $(LNAME2 traits-members-visibility, The `allMembers` and `derivedMembers` traits now only return visible symbols.))

$(P Since changing the protection system from access to visibility checks
(see $(DDSUBLINK changelog/2.071.0, dip22, DIP22)), using the
$(DDSUBLINK spec/traits, getMember, `getMember`) traits would often
result in spurious deprecation warnings for invisible (private) symbols
in $(DDSUBLINK spec/traits, allMembers, `allMembers`) or
$(DDSUBLINK spec/traits, derivedMembers, `derivedMembers`). As the symbols
weren't accessible before and are now invisible, the implementation of the
traits was changed to no longer list those.
)

$(P To ease updating existing code, the old behavior can be restored using
the `-transition=import` compiler switch.
)

$(P 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.
)

$(P 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);
---

$(P See also $(BUGZILLA 15907))
)
)

$(BR)$(BIG $(LNAME2 bugfix-list, List of all bug fixes and enhancements in D $(VER):))

$(BUGSTITLE DMD Compiler regressions,

$(P
$(LI $(BUGZILLA 15780): [REG2.069] CTFE foreach fails with tuple)
$(LI $(BUGZILLA 15900): [REG 2.071] $(LPAREN)Import deprecation$(RPAREN) Public import ignored when using fully qualified name)
$(LI $(BUGZILLA 15907): Unjustified "is not visible from module" deprecation warning when using getMember trait)
$(LI $(BUGZILLA 16085): wrong visibility warning for overloaded alias symbol)
$(LI $(BUGZILLA 16188): [REG2.069] ICE on invalid code)
$(LI $(BUGZILLA 16225): [REG 2.068] Internal error cod1.c 1338 with -O)
Expand Down
2 changes: 1 addition & 1 deletion download.dd
Expand Up @@ -170,7 +170,7 @@ Macros:
_=BETA=$(COMMENT $0)
BETA=$0
B_DMDV2=2.071.2
B_SUFFIX=b2
B_SUFFIX=b3

DEB32=$(DLSITE dmd_$(DMDV2)-0_i386.deb)
DEB64=$(DLSITE dmd_$(DMDV2)-0_amd64.deb)
Expand Down
2 changes: 2 additions & 0 deletions spec/traits.dd
Expand Up @@ -802,6 +802,7 @@ $(H2 $(GNAME allMembers))
A tuple of string literals is returned, each of which
is the name of a member of that type combined with all
of the members of the base classes (if the type is a class).
Only members visible in the current scope are listed.
No name is repeated.
Builtin properties are not included.
)
Expand Down Expand Up @@ -834,6 +835,7 @@ $(H2 $(GNAME derivedMembers))
a type or an expression of type.
A tuple of string literals is returned, each of which
is the name of a member of that type.
Only members visible in the current scope are listed.
No name is repeated.
Base class member names are not included.
Builtin properties are not included.
Expand Down

0 comments on commit d053219

Please sign in to comment.