Bug 20764 – [The D Bug Tracker] std.traits.isAggregateType chokes on modules

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-23T19:42:48Z
Last change time
2024-12-01T16:36:37Z
Assigned to
No Owner
Creator
Jean-Louis Leroy
Moved to GitHub: phobos#10414 →

Comments

Comment #0 by jl — 2020-04-23T19:42:48Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10414 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB