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
19 lines
415 B
D
19 lines
415 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/ice15332.d(16): Error: calling non-static function `fun` requires an instance of type `C`
|
|
fail_compilation/ice15332.d(17): Error: accessing non-static variable `var` requires an instance of `C`
|
|
---
|
|
*/
|
|
|
|
class C
|
|
{
|
|
int fun() { return 5; }
|
|
int var;
|
|
|
|
void test()
|
|
{
|
|
int a1 = function() { return fun; }();
|
|
int a2 = function() { return var; }();
|
|
}
|
|
}
|