It seems that you can throw just about anything at isAggregateType, but not a module:
module test;
import std.traits;
pragma(msg, isAggregateType!test);
t.d(3): Error: template instance `isAggregateType!(test)` does not match template declaration `isAggregateType(T)`
t.d(3): while evaluating `pragma(msg, isAggregateType!(test))`
Suggested fix: change the definition to:
enum isAggregateType(T...) =
is(T[0] == struct) || is(T[0] == union) || is(T[0] == class)
|| is(T[0] == interface);
Comment #1 by moonlightsentinel — 2020-04-25T23:10:46Z
A module is not a type (strictly speaking). Might be less problematic if this trait was named isAggregate
Comment #2 by robert.schadek — 2024-12-01T16:36:37Z