Skip to content

Commit

Permalink
Merge pull request #4672 from 9rnsr/fix14609
Browse files Browse the repository at this point in the history
[REG2.068a] Issue 14609 - Github HEAD: DMD assertion failure for valid code
  • Loading branch information
yebblies committed May 20, 2015
2 parents 14273b3 + 6e0a27b commit ba848af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,14 +1564,8 @@ void InterfaceDeclaration::semantic(Scope *sc)
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
/* There are problems doing this in the general case because
* Scope keeps track of things like 'offset'
*/
if (s->isEnumDeclaration() || (s->isAggregateDeclaration() && s->ident))
{
//printf("setScope %s %s\n", s->kind(), s->toChars());
s->setScope(sc2);
}
//printf("setScope %s %s\n", s->kind(), s->toChars());
s->setScope(sc2);
}

for (size_t i = 0; i < members->dim; i++)
Expand Down
14 changes: 14 additions & 0 deletions test/compilable/testfwdref.d
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ class Frop14549
}

// ----
// regression case

template Mix14549()
{
Expand All @@ -477,3 +478,16 @@ class Bar14549
mixin Mix14549;
int boo;
}

// ----
// 14609 - regression case

interface Foo14609(T)
{
static if (is(T == int))
public int bar();
}
class Frop14609 : Foo14609!int
{
public int bar() { return 0; }
}

0 comments on commit ba848af

Please sign in to comment.