Skip to content

Commit

Permalink
clean code style
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 15, 2015
1 parent f39fd49 commit 57c510d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -2582,15 +2582,19 @@ public:
final Expression noMember(Scope* sc, Expression e, Identifier ident, int flag)
{
assert(ty == Tstruct || ty == Tclass);
AggregateDeclaration sym = toDsymbol(sc).isAggregateDeclaration();
auto sym = toDsymbol(sc).isAggregateDeclaration();
assert(sym);
if (ident != Id.__sizeof && ident != Id.__xalignof && ident != Id._init && ident != Id._mangleof && ident != Id.stringof && ident != Id.offsetof)
if (ident != Id.__sizeof &&
ident != Id.__xalignof &&
ident != Id._init &&
ident != Id._mangleof &&
ident != Id.stringof &&
ident != Id.offsetof)
{
/* Look for overloaded opDot() to see if we should forward request
* to it.
*/
Dsymbol fd = search_function(sym, Id.opDot);
if (fd)
if (auto fd = search_function(sym, Id.opDot))
{
/* Rewrite e.ident as:
* e.opDot().ident
Expand All @@ -2599,11 +2603,11 @@ public:
e = new DotIdExp(e.loc, e, ident);
return e.semantic(sc);
}

/* Look for overloaded opDispatch to see if we should forward request
* to it.
*/
fd = search_function(sym, Id.opDispatch);
if (fd)
if (auto fd = search_function(sym, Id.opDispatch))
{
/* Rewrite e.ident as:
* e.opDispatch!("ident")
Expand All @@ -2630,6 +2634,7 @@ public:
e = null;
return e;
}

/* See if we should forward to the alias this.
*/
if (sym.aliasthis)
Expand Down

0 comments on commit 57c510d

Please sign in to comment.