mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* Improve "need `this`" error for function calls * Improve "need `this`" error for member variables * Improve "need this" error for address of variable * Remove dead error
20 lines
377 B
D
20 lines
377 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail11545.d(14): Error: accessing non-static variable `x` requires an instance of `C`
|
|
fail_compilation/fail11545.d(18): Error: accessing non-static variable `x` requires an instance of `C`
|
|
---
|
|
*/
|
|
|
|
class C
|
|
{
|
|
int x = 42;
|
|
|
|
int function() f1 = function() {
|
|
return x;
|
|
};
|
|
|
|
int function() f2 = {
|
|
return x;
|
|
};
|
|
}
|