Files
ldc/tests/mini/nested5.d
Tomas Lindquist Olsen daad516579 Removed the 'needsstorage' thing from Dsymbol. Arguments are not always given storage when applicable. This is not longer treat specially
in this regard. Code for accessing nested variables and contexts rewritten. Probably more. Fairly well tested.
2008-08-04 02:59:34 +02:00

24 lines
340 B
D

module nested5;
extern(C) int printf(char*, ...);
void main()
{
int i = 42;
printf("Hello world %d\n", i++);
class C
{
void func()
{
printf("Hello nested world %d\n", i++);
//i++;
}
}
auto c = new C;
c.func();
printf("i = %d\n", i);
assert(i == 44);
}