@@ -587,9 +587,11 @@ template hasIndirections(T)
587587 else static if (__traits(isAssociativeArray, T) || is (T == class ) || is (T == interface ))
588588 enum hasIndirections = true ;
589589 else static if (is (T == E[N], E, size_t N))
590- enum hasIndirections = T.sizeof && ( is ( immutable E == immutable void ) || hasIndirections! (BaseElemOf! E) );
590+ enum hasIndirections = T.sizeof && hasIndirections! (BaseElemOf! E);
591591 else static if (isFunctionPointer! T)
592592 enum hasIndirections = false ;
593+ else static if (is (immutable (T) == immutable (void )))
594+ enum hasIndirections = true ;
593595 else
594596 enum hasIndirections = isPointer! T || isDelegate! T || isDynamicArray! T;
595597}
@@ -750,11 +752,11 @@ template hasIndirections(T)
750752// https://github.com/dlang/dmd/issues/20812
751753@safe unittest
752754{
753- static assert (! hasIndirections! void );
754- static assert (! hasIndirections! (const void ));
755- static assert (! hasIndirections! (inout void ));
756- static assert (! hasIndirections! (immutable void ));
757- static assert (! hasIndirections! (shared void ));
755+ static assert ( hasIndirections! void );
756+ static assert ( hasIndirections! (const void ));
757+ static assert ( hasIndirections! (inout void ));
758+ static assert ( hasIndirections! (immutable void ));
759+ static assert ( hasIndirections! (shared void ));
758760
759761 static assert ( hasIndirections! (void * ));
760762 static assert ( hasIndirections! (const void * ));
0 commit comments