On Thursday, 19 March 2020 at 14:43:53 UTC, Steven Schveighoffer wrote:
I think this is an invalid limitation, you should file an issue at https://issues.dlang.org

essentially, with your sample A struct:

const f1 = &A.fn; // OK
const f2 = &A.d; // Error, not constant expression

Both these should be valid, &A.d is not a delegate, but a function pointer.

-Steve

https://issues.dlang.org/show_bug.cgi?id=20687
https://github.com/dlang/dmd/pull/10946

Reply via email to