diff --git a/src/parse.c b/src/parse.c index 5367c3aa6ba0..719712d204a6 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2891,14 +2891,13 @@ Dsymbols *Parser::parseDeclarations(StorageClass storage_class, unsigned char *c addComment(s, comment); return a; } -#if 0 /* Look for: - * alias this = identifier; + * alias this : identifier; */ - if (token.value == TOKthis && peekNext() == TOKassign && peekNext2() == TOKidentifier) + if (token.value == TOKthis && peekNext() == TOKcolon && peekNext2() == TOKidentifier) { check(TOKthis); - check(TOKassign); + check(TOKcolon); AliasThis *s = new AliasThis(loc, token.ident); nextToken(); check(TOKsemicolon); @@ -2907,7 +2906,6 @@ Dsymbols *Parser::parseDeclarations(StorageClass storage_class, unsigned char *c addComment(s, comment); return a; } -#endif /* Look for: * alias identifier = type; */ diff --git a/test/compilable/aliasdecl.d b/test/compilable/aliasdecl.d index cb56e987d3e0..40e6bac7f7cc 100644 --- a/test/compilable/aliasdecl.d +++ b/test/compilable/aliasdecl.d @@ -24,12 +24,12 @@ void main() static assert(is(Y4 == void delegate() const)); static assert(is(Y5.Type == int)); - /+ struct S + struct S { int value; - alias this = value; + alias this : value; } auto s = S(10); int n = s; - assert(n == 10); +/ + assert(n == 10); }