Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
Hello, I tried to narrow the problem and make a small example, but I've failed. I try to describe the syndrome, maybe someone knows about it. (I heard that @properties are not 100% functional, maybe it's because of that, I dunno...) With pragma msg, I verify the time of things: karcSamples

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Only the extra () let it compile successfuly. No way to fix it. If the function takes an extra argument you can kinda trick it but for zero arg function pointer return from a property it is just plain broken and has been the whole time.

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Update: ``` auto x = karcSamples[a.key].lod0; print(x._size); auto y = karcSamples[a.key].lod0(); print(y._size); with(karcSamples[a.key].lod0) print(_size); with(karcSamples[a.key].lod0()) print(_size); ``` When I put it into a tem

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:11:45 UTC, Adam D Ruppe wrote: On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Only the extra () let it compile successfuly. No way to fix it. If the function takes an extra argument you can kinda trick it but for zero arg function pointer return from a pr

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-27 Thread realhet via Digitalmars-d-learn
It seems like I managed to solve it. All the chain of properties now capturing a generic value type T. And finally the most inner associative array will handle the implicit cast. Maybe that extra implicit () got confused when the types are same, but the aliases to those types are different. o.O