Example: ----------------------------------------------------------------- enum EnumArray : int[2] { a = [ 1, 2 ], b = [ 3, 4 ] } static assert(!__traits(isStaticArray, EnumArray)); // Fails // Expected equal behaviour of trait and is-expression static assert(!is(EnumArray == T[n], T, size_t n)); // Passes ----------------------------------------------------------------- The spec[1] states that a named enum creates a distinct type which is implicitly convertible to it's base type. So EnumArray is not a static array and __traits(isStaticArray, EnumArray) should yield `false` as done for the equivalent is-expression. [1] https://dlang.org/spec/enum.html#named_enums
@MoonlightSentinel created dlang/phobos pull request #7760 "Make isAutoDecodableString independent of issue 21570" mentioning this issue: - Make isAutoDecodableString independent of issue 21570 The current implementation relies on issue 21570 to reject enums with static arrays as their base type. Use another is-expression instead of `isStaticArray` to detect types that are (convertible to) static arrays. See https://issues.dlang.org/show_bug.cgi?id=21570 https://github.com/dlang/phobos/pull/7760
dlang/phobos pull request #7760 "Make isAutoDecodableString independent of issue 21570" was merged into master: - 7c13ddf8de6bbaf287a60ebac7e3f31acf45ecec by MoonlightSentinel: Make isAutoDecodableString independent of issue 21570 The current implementation relies on issue 21570 to reject enums with static arrays as their base type. Use another is-expression instead of `isStaticArray` to detect types that are (convertible to) static arrays. See https://issues.dlang.org/show_bug.cgi?id=21570 https://github.com/dlang/phobos/pull/7760
@MoonlightSentinel updated dlang/dmd pull request #12142 "Fix 21570 - __traits(isStaticArray, ...) accepts enums with static..." mentioning this issue: - Issue 21570 - Deprecate __traits(isStaticArray, ...) accepts enums ...with static array as base type. The spec[1] states that a named enum creates a distinct type which is implicitly convertible to it's base type. Hence `__traits(isStaticArray, <enum>)` should yield `false` as done for an equivalent `is(...)` expression. [1] https://dlang.org/spec/enum.html#named_enums https://github.com/dlang/dmd/pull/12142