mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
36 lines
459 B
D
36 lines
459 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail224.d(22): Error: need `this` of type `A` to access member `x` from static function `f`
|
|
---
|
|
*/
|
|
|
|
int gi;
|
|
|
|
class A
|
|
{
|
|
int x = 42;
|
|
|
|
void am()
|
|
{
|
|
static void f()
|
|
{
|
|
class B
|
|
{
|
|
void bm()
|
|
{
|
|
gi = x;
|
|
}
|
|
}
|
|
|
|
(new B).bm();
|
|
}
|
|
|
|
f();
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
(new A).am();
|
|
}
|