www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21647] New: pragma(msg) should be able to print a void type

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

          Issue ID: 21647
           Summary: pragma(msg) should be able to print a void type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following:

  alias V = void;
  pragma(msg, V);

should print:

  void

And it does when the pragma is inside a function! But when it as global level,
it prints:

  Error: Cannot pass argument void to pragma msg because it is void

This problem was introduced in https://github.com/dlang/dmd/pull/7316 as a fix
for  https://issues.dlang.org/show_bug.cgi?id=17382. Unfortunately, it altered
the code for PragmaDeclaration but not PragmaStatement, hence the difference.
But the 17382 bug remains.

Essentially, 7316 was not a correct fix for 17382.

--
Feb 19 2021