Skip to content

Commit

Permalink
Merge pull request #8486 from RazvanN7/Issue_19076
Browse files Browse the repository at this point in the history
[REG] Fix Issue 19076 - dmd 2.081 crashed by getVirtualFunctions for a interface extended interface
  • Loading branch information
wilzbach committed Jul 11, 2018
2 parents 55094b1 + 945a58e commit e810f3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dmd/traits.d
Expand Up @@ -1010,7 +1010,7 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
// If the symbol passed as a parameter is an
// interface that inherits other interfaces
overloadApply(f, &dg);
if (ifd && ifd.interfaces)
if (ifd && ifd.interfaces && f)
{
// check the overloads of each inherited interface individually
foreach (bc; ifd.interfaces)
Expand Down
11 changes: 11 additions & 0 deletions test/fail_compilation/fail19076.d
@@ -0,0 +1,11 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail19076.d(11): Error: no property `V` for type `fail19076.I`
fail_compilation/fail19076.d(11): Error: `(I).V` cannot be resolved
---
*/

interface P { }
interface I : P { }
auto F = __traits(getVirtualFunctions, I, "V");

0 comments on commit e810f3f

Please sign in to comment.