Skip to content

Commit

Permalink
Fix Issue 19064 - [REG2.081] Vibe.d's InterfaceProxy no longer works
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanN7 authored and wilzbach committed Jul 5, 2018
1 parent 025693e commit d3f65c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/dmd/traits.d
Expand Up @@ -1009,6 +1009,7 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
ifd = sym.isInterfaceDeclaration();
// If the symbol passed as a parameter is an
// interface that inherits other interfaces
overloadApply(f, &dg);
if (ifd && ifd.interfaces)
{
// check the overloads of each inherited interface individually
Expand All @@ -1018,8 +1019,6 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
overloadApply(fd, &dg);
}
}
else
overloadApply(f, &dg);

auto tup = new TupleExp(e.loc, exps);
return tup.expressionSemantic(scx);
Expand Down
14 changes: 13 additions & 1 deletion test/runnable/test17373.d → test/compilable/test17373.d
@@ -1,3 +1,4 @@
// https://issues.dlang.org/show_bug.cgi?id=17373
interface Foo { void visit (int); }
interface Bar { void visit(double); }
interface FooBar : Foo, Bar {}
Expand All @@ -17,4 +18,15 @@ interface Simple
}
static assert(__traits(getOverloads, Simple, "square").length == 2);

void main() {}
// https://issues.dlang.org/show_bug.cgi?id=19064
interface InputStream {}
interface OutputStream{}
interface Stream : InputStream, OutputStream{}
interface ConnectionStream : Stream
{
@property bool connected() const;
void close();
}

static assert(__traits(getOverloads, ConnectionStream, "connected").length == 1);
static assert(__traits(getOverloads, ConnectionStream, "close").length == 1);

0 comments on commit d3f65c7

Please sign in to comment.