////////////////////////////// test.d ///////////////////////////// struct S { @property size_t count() const { return 1; } } int[S.init.count()] x; // OK int[S.init.count ] y; // error // Error: need `this` for `count` of type `const @property ulong()` /////////////////////////////////////////////////////////////////// Additionally, the error message is misleading. Older versions of compilers produced a better error: 2.079.0 to 2.087.1: Failure with output: test.d(9): Error: integer constant expression expected instead of `S().count`
@TungstenHeart created dlang/dmd pull request #12481 "fix 21870 - Property/method not invoked and requires () when used in static array length" fixing this issue: - fix 21870 - Property/method not invoked and requires () when used in static array length https://github.com/dlang/dmd/pull/12481
dlang/dmd pull request #12481 "fix 21870 - Property/method not invoked and requires () when used in static array length" was merged into master: - 700a75c7179c1bc5fbbc89183961c3d8fd8e63a9 by Basile Burg: fix 21870, 15478 - Property/method not invoked and requires () when used in static array length https://github.com/dlang/dmd/pull/12481