mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +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
22 lines
371 B
D
22 lines
371 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/bug8891.d(21): Error: calling non-static function `opCall` requires an instance of type `S`
|
|
---
|
|
*/
|
|
|
|
struct S
|
|
{
|
|
int value = 10;
|
|
S opCall(int n) // non-static
|
|
{
|
|
//printf("this.value = %d\n", this.value); // prints garbage!
|
|
S s;
|
|
s.value = n;
|
|
return s;
|
|
}
|
|
}
|
|
void main()
|
|
{
|
|
S s = 10;
|
|
}
|