Skip to content

Commit

Permalink
Merge pull request #2818 from 9rnsr/fix7645
Browse files Browse the repository at this point in the history
Issue 7645 - ICE(e2ir.c) nested classes
  • Loading branch information
yebblies committed Nov 18, 2013
2 parents 7512d97 + 54d6e35 commit 346988f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -10670,6 +10670,8 @@ Expression *DotExp::semantic(Scope *sc)
return e;
}
}
if (e2->op == TOKtype)
return e2;
if (!type)
type = e2->type;
return this;
Expand Down
32 changes: 32 additions & 0 deletions test/fail_compilation/ice7645.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice7645.d(28): Error: need 'this' for 't' of type 'char'
fail_compilation/ice7645.d(31): Error: need 'this' for 'fn' of type 'pure nothrow @safe void()'
---
*/

class C
{
class C2()
{
char t;
}
}

struct S
{
struct S2(T)
{
void fn() {}
}
}

void main()
{
C c;
auto v = c.C2!().t;

S s;
s.S2!int.fn();
}
2 changes: 1 addition & 1 deletion test/fail_compilation/ice9545.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
TEST_OUTPUT:
----
fail_compilation/ice9545.d(13): Error: expression has no value
fail_compilation/ice9545.d(13): Error: type int has no value
----
*/

Expand Down

0 comments on commit 346988f

Please sign in to comment.