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

21 lines
292 B
D

// PERMUTE_ARGS: -inline
/*
TEST_OUTPUT:
---
fail_compilation/fail46.d(19): Error: calling non-static function `bug` requires an instance of type `MyStruct`
---
*/
struct MyStruct
{
int bug()
{
return 3;
}
}
int main()
{
assert(MyStruct.bug() == 3);
return 0;
}