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
376 B
D
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();
|
|
}
|
|
}
|