www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17701] New: DMD does not properly gag errors when passing

https://issues.dlang.org/show_bug.cgi?id=17701

          Issue ID: 17701
           Summary: DMD does not properly gag errors when passing `typeof`
                    to a template inside __traits(compiles)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: monkeyworks12 hotmail.com

import std.meta: AliasSeq, staticMap;

alias typesAndValues = AliasSeq!(int, false, char, "test");

//Error: found ',' when expecting '('
//Error: found ';' when expecting ')' following template argument list
//Error: semicolon expected to close alias declaration
assert(!__traits(compiles, { alias justTypes = staticMap!(typeof,
typeAndValues); }));

Tested with DMD 2.075.0. I'm not sure if this is a regression or not.

--
Jul 28 2017