Why doesn't this work when the function is a static method?

Jack jckj33 at gmail.com
Thu Jan 14 05:44:43 UTC 2021


On Wednesday, 13 January 2021 at 17:21:23 UTC, Paul Backus wrote:
> On Wednesday, 13 January 2021 at 17:14:04 UTC, Jack wrote:
>> but if I wrap this within a class:
>>
>> class Foo
>> {
>>     static int f(HWND hwnd, int n)
>>     {
>>         return n*10;
>>     }
>>
>>
>>     static void baa()
>>     {
>>         HWND foo;
>>         writeln(foo.f(10));
>>     }
>> }
>>
>> I get the error:
>>
>> Error: no property f for type void*
>
> Member functions (including static ones) can't be called with 
> UFCS.

Thanks
  is this documented somewhere? Is this going to change?


More information about the Digitalmars-d-learn mailing list