[Issue 13605] New: Add ability to `version` a module declaration

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 12 05:38:51 PDT 2014


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

          Issue ID: 13605
           Summary: Add ability to `version` a module declaration
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: slavo5150 at yahoo.com

The idea is to have the same module declaration in multiple files, but guarded
by `version`.

// port_linux.d
version (linux):
module port;

// port_windows.d
version (Windows):
module port;

Unfortunately, this fails to compile with the following error:
 Error: Declaration expected, not 'module'

It could provide some interesting alternatives for Issue 11666.

Recently implemented related enhancements
* Issue 12567 - https://github.com/D-Programming-Language/dmd/pull/3907
* https://github.com/D-Programming-Language/dmd/pull/3947

--


More information about the Digitalmars-d-bugs mailing list