Skip to content

Commit

Permalink
Merge pull request #3158 from tom-tan/workaround-for-14405
Browse files Browse the repository at this point in the history
Add workaround for issue 1238
  • Loading branch information
burner committed Jun 27, 2015
2 parents bcedffd + a96d7c0 commit 5faa1cc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions std/typecons.d
Expand Up @@ -3443,7 +3443,8 @@ unittest
version(unittest)
{
// Issue 10647
private string generateDoNothing(C, alias fun)() @property
// Add prefix "issue10647_" as a workaround for issue 1238
private string issue10647_generateDoNothing(C, alias fun)() @property
{
string stmt;

Expand All @@ -3457,25 +3458,25 @@ version(unittest)
return stmt;
}

private template isAlwaysTrue(alias fun)
private template issue10647_isAlwaysTrue(alias fun)
{
enum isAlwaysTrue = true;
enum issue10647_isAlwaysTrue = true;
}

// Do nothing template
private template DoNothing(Base)
private template issue10647_DoNothing(Base)
{
alias DoNothing = AutoImplement!(Base, generateDoNothing, isAlwaysTrue);
alias issue10647_DoNothing = AutoImplement!(Base, issue10647_generateDoNothing, issue10647_isAlwaysTrue);
}

// A class to be overridden
private class Foo{
private class issue10647_Foo{
void bar(int a) { }
}
}
unittest
{
auto foo = new DoNothing!Foo();
auto foo = new issue10647_DoNothing!issue10647_Foo();
foo.bar(13);
}

Expand Down

0 comments on commit 5faa1cc

Please sign in to comment.