Skip to content

Commit

Permalink
Merge pull request #3897 from 9rnsr/fix13374
Browse files Browse the repository at this point in the history
[REG2.061] Issue 13374 - Wrong template overload resolution when passing function to alias/string parameter
  • Loading branch information
WalterBright committed Aug 25, 2014
2 parents a7786fa + 586686e commit 639bcaa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/template.c
Expand Up @@ -5355,7 +5355,7 @@ MATCH TemplateValueParameter::matchArg(Scope *sc, RootObject *oarg,
ei = new VarExp(loc, f);
ei = ei->semantic(sc);
if (!f->needThis())
ei = resolveProperties(sc, ei);
ei = resolvePropertiesOnly(sc, ei);
/* If it was really a property, it will become a CallExp.
* If it stayed as a var, it cannot be interpreted.
*/
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/template9.d
Expand Up @@ -4104,6 +4104,19 @@ void test13333()
}
}

/******************************************/
// 13374

int f13374(alias a)() { return 1; }
int f13374(string s)() { return 2; }

void x13374(int i) {}

void test13374()
{
assert(f13374!x13374() == 1);
}

/******************************************/

int main()
Expand Down Expand Up @@ -4208,6 +4221,7 @@ int main()
test13235();
test13294();
test13299();
test13374();

printf("Success\n");
return 0;
Expand Down

0 comments on commit 639bcaa

Please sign in to comment.