[Issue 20764] New: [The D Bug Tracker] std.traits.isAggregateType chokes on modules
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu Apr 23 19:42:48 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=20764
          Issue ID: 20764
           Summary: [The D Bug Tracker] std.traits.isAggregateType chokes
                    on modules
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jl at leroy.nyc
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);
--
    
    
More information about the Digitalmars-d-bugs
mailing list