dmd/compiler/test/fail_compilation/diag9635.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

20 lines
376 B
D

// REQUIRED_ARGS: -m32
/*
TEST_OUTPUT:
---
fail_compilation/diag9635.d(17): Error: accessing non-static variable `i` requires an instance of `Foo`
fail_compilation/diag9635.d(18): Error: calling non-static function `foo` requires an instance of type `Foo`
---
*/
struct Foo
{
int i;
void foo()() { }
static void bar()
{
i = 4;
foo();
}
}