Skip to content

Commit

Permalink
revert pull dlang#809
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Mar 14, 2012
1 parent dc89c64 commit cd6f78e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,10 +1377,15 @@ Parameters *Parser::parseParameters(int *pvarargs, TemplateParameters **tpl)
error("scope cannot be ref or out");

Token *t;
#if 1
if (tpl && !stc && token.value == TOKidentifier &&
(t = peek(&token), (t->value == TOKcomma || t->value == TOKrparen)))
#else
if (tpl && token.value == TOKidentifier &&
(t = peek(&token), (t->value == TOKcomma ||
t->value == TOKrparen ||
t->value == TOKdotdotdot)))
#endif
{ Identifier *id = Lexer::uniqueId("__T");
at = new TypeIdentifier(loc, id);
if (!*tpl)
Expand Down
2 changes: 2 additions & 0 deletions test/runnable/funclit.d
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ void test7650()

void test7705()
{
/+
void foo1(void delegate(ref int ) dg){ int x=10; dg(x); }
foo1((ref x){ pragma(msg, typeof(x)); assert(x == 10); });
static assert(!__traits(compiles, foo1((x){}) ));
Expand All @@ -500,6 +501,7 @@ void test7705()
void foo3(void delegate(int[]...) dg){ dg(1, 2, 3); }
foo3((x ...){ pragma(msg, typeof(x)); assert(x == [1,2,3]); });
+/
}

/***************************************************/
Expand Down

0 comments on commit cd6f78e

Please sign in to comment.