Skip to content

Commit

Permalink
Revert "Allow property function has two arguments"
Browse files Browse the repository at this point in the history
This reverts commit 9ffddbf.
  • Loading branch information
WalterBright committed Mar 20, 2012
1 parent cc28ed0 commit 3d82b3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mtype.c
Expand Up @@ -5589,8 +5589,8 @@ Type *TypeFunction::semantic(Loc loc, Scope *sc)
return terror;
}

if (tf->isproperty && (tf->varargs || Parameter::dim(tf->parameters) > 2))
error(loc, "properties can only have zero, one, or two parameter");
if (tf->isproperty && (tf->varargs || Parameter::dim(tf->parameters) > 1))
error(loc, "properties can only have zero or one parameter");

if (tf->varargs == 1 && tf->linkage != LINKd && Parameter::dim(tf->parameters) == 0)
error(loc, "variadic functions with non-D linkage must have at least one parameter");
Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/fail334.d
@@ -1,7 +1,7 @@

struct S
{
@property int foo(int a, int b, int c) { return 1; }
@property int foo(int a, int b) { return 1; }
}

void main()
Expand Down

0 comments on commit 3d82b3f

Please sign in to comment.