dmd/compiler/test/fail_compilation/fail120.d
Dennis c4e84f226e
Improve "need this" error (#15430)
* 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
2023-07-20 12:41:02 +03:00

14 lines
355 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail120.d(12): Error: accessing non-static variable `nodes` requires an instance of `Foo`
fail_compilation/fail120.d(13): Error: accessing non-static variable `nodes` requires an instance of `Foo`
---
*/
class Foo
{
int[2] nodes;
auto left = (){ return nodes[0]; };
auto right = (){ return nodes[1]; };
}